Skip to content

Conversation

@MatheusNSantiago
Copy link

Summary

This PR adds the ability to enable/disable specific MCP tools through the tools field in cclsp.json.

Problem: Currently, all 12 tools are always exposed, which can clutter the context window when only a few tools are needed.

Solution: Allow users to configure which tools are enabled via config:

{
  "tools": {
    "rename_symbol": true,
    "find_references": true,
    "find_definition": false,
    "get_diagnostics": false,
    "get_hover": false,
    "find_workspace_symbols": false,
    "find_implementation": false,
    "prepare_call_hierarchy": false,
    "get_incoming_calls": false,
    "get_outgoing_calls": false,
    "rename_symbol_strict": false,
    "restart_server": false
  },
  "servers": [...]
}
  • Tools not listed default to enabled (backward compatible)
  • Tools set to false are not exposed via ListTools
  • Calling a disabled tool returns a helpful error message

Changes

  • src/types.ts: Added tools?: Record<string, boolean> to Config interface
  • src/lsp-client.ts: Added public getter for tools config
  • index.ts: Extracted tool definitions to ALL_TOOLS constant and filter in ListToolsRequestSchema handler

Allow users to enable/disable specific MCP tools through the `tools`
field in cclsp.json. Tools not listed default to enabled; set to
`false` to disable.

Example config:
```json
{
  "tools": {
    "rename_symbol": true,
    "find_references": true,
    "find_definition": false,
    "get_diagnostics": false
  },
  "servers": [...]
}
```

This addresses the need to reduce context window usage by exposing
only the tools actually needed for a workflow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant