gitcode_api.llm.mcp

FastMCP integration for the GitCode SDK LLM tool.

Functions

create_mcp_gitcode_api_tool([tool])

Return the async callable that can be registered with an MCP server.

create_mcp_server([name, tool])

Create a FastMCP server with the GitCode API tool already registered.

register_mcp_gitcode_api_tool(mcp[, tool])

Register the GitCode API tool with an existing FastMCP-compatible server.

Classes

GitCodeMCP([name, tool])

Small FastMCP server wrapper exposing the GitCode API tool.

class GitCodeMCP(name: str = 'GitCode API', tool: GitCodeLLMTool | None = None, **kwargs)

Bases: object

Small FastMCP server wrapper exposing the GitCode API tool.

Parameters:
  • name – MCP server name.

  • tool – Optional preconfigured shared GitCode LLM tool.

  • kwargs – Forwarded to fastmcp.FastMCP.

Create a FastMCP server and register the GitCode API tool.

create_mcp_gitcode_api_tool(tool: GitCodeLLMTool | None = None) Any

Return the async callable that can be registered with an MCP server.

Parameters:

tool – Optional preconfigured shared GitCode LLM tool.

Returns:

Async callable using the standard GitCode tool parameters.

create_mcp_server(name: str = 'GitCode API', tool: GitCodeLLMTool | None = None, **kwargs) FastMCP

Create a FastMCP server with the GitCode API tool already registered.

register_mcp_gitcode_api_tool(mcp: FastMCP | Any, tool: GitCodeLLMTool | None = None) Any

Register the GitCode API tool with an existing FastMCP-compatible server.

Parameters:
  • mcp – FastMCP server instance.

  • tool – Optional preconfigured shared GitCode LLM tool.

Returns:

The registered tool callable.