MCP Server¶
The MCP surface is pinned at nine task-shaped tools — get_overview,
search_codebase, get_symbol, get_context, get_references,
get_why, grep, glob and read_file — registered by
run() (frozen contract: docs/tool-contracts.md).
The tools themselves are closures inside the server module; each validates the
matching pydantic input model below and delegates to the ToolRouter (the
three filesystem tools delegate to the FileToolsService, which walks the
indexer’s discovery scope). run serves a single project (db_path) or
several — a workspace directory or explicit db_paths for read-only
multi-repo serving — and accepts gpu=True to run query-time embedding on
CUDA.
- pydocs_mcp.server.run(db_path=None, config_path=None, *, gpu=False, workspace=None, db_paths=None, descriptions_path=None)[source]¶
Start the MCP server over one project (
db_path) or several — aworkspacedir or explicitdb_paths(read-only multi-repo).descriptions_pathis the--descriptionsoverride document (highest-precedence description source, ADR 0006).
Tool input schemas¶
- class pydocs_mcp.application.mcp_inputs.OverviewInput(*, package='', project='')[source]¶
Bases:
BaseModelget_overview — orientation card scope (spec §D1/§D17).
- model_config = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pydocs_mcp.application.mcp_inputs.SearchInput(*, query, kind='any', package='', scope='all', project='', limit=<factory>)[source]¶
Bases:
BaseModelInput for the
search_codebaseMCP tool.- Parameters:
- model_config = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pydocs_mcp.application.mcp_inputs.SymbolInput(*, target, depth='summary', project='')[source]¶
Bases:
BaseModelget_symbol — known dotted path (spec §D1). depth=’source’ is the §D7 recovery contract.
- Parameters:
- model_config = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pydocs_mcp.application.mcp_inputs.ContextInput(*, targets, project='')[source]¶
Bases:
BaseModelget_context — batched targets under one shared budget (spec §D1).
- Parameters:
- model_config = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pydocs_mcp.application.mcp_inputs.ReferencesInput(*, target, direction='callers', project='', limit=<factory>)[source]¶
Bases:
BaseModelget_references — graph traversal incl. ranked transitive impact (spec §D1).
- Parameters:
- model_config = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pydocs_mcp.application.mcp_inputs.WhyInput(*, query='', targets=None, project='')[source]¶
Bases:
BaseModelget_why — decision search / per-target governing decisions / dashboard (spec §D11).
- Parameters:
- model_config = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pydocs_mcp.application.mcp_inputs.GrepInput(*, pattern, path='', glob='', output_mode='files_with_matches', case_insensitive=False, line_numbers=True, after_context=None, before_context=None, context=None, head_limit=None, multiline=False, scope='project', project='')[source]¶
Bases:
BaseModelgrep — exact-string / regex text search over source files (§3.7).
- Parameters:
- model_config = {'populate_by_name': True, 'validate_by_alias': True, 'validate_by_name': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pydocs_mcp.application.mcp_inputs.GlobInput(*, pattern, path='', head_limit=None, project='')[source]¶
Bases:
BaseModelglob — find files by name pattern, mtime-descending (§3.8).
- Parameters:
- model_config = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class pydocs_mcp.application.mcp_inputs.ReadFileInput(*, file_path, offset=None, limit=None, project='')[source]¶
Bases:
BaseModelread_file — line-numbered file content within the corpus boundary (§3.9).
- Parameters:
- model_config = {}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
LookupInput is no longer a tool schema: it survives as the internal
request contract that get_symbol / get_references build when
delegating to the lookup router (see application/tool_router.py).