mcp_api.mdβ’2.9 kB
# MCP API Reference
This section provides details about the Model Context Protocol (MCP) API endpoints implemented by Adaptive Graph of Thoughts.
## Overview
Adaptive Graph of Thoughts implements an MCP server to allow integration with MCP clients such as Claude Desktop. The primary endpoint for MCP communication is `/mcp`.
This endpoint accepts `GET`, `POST`, and `DELETE` requests. Configuration values passed by Smithery are supplied as query parameters using dot notation, for example `GET /mcp?server.host=localhost&server.port=8080`.
## Methods
The following JSON-RPC methods are supported via the `/mcp` endpoint:
### `initialize`
* **Description:** Initializes the session between the MCP client and the Adaptive Graph of Thoughts server. Provides server information to the client.
* **Parameters:** See `MCPInitializeParams` in `src/adaptive_graph_of_thoughts/api/schemas.py`.
* **Returns:** `MCPInitializeResult` (see `src/adaptive_graph_of_thoughts/api/schemas.py`).
### `asr_got.query`
* **Description:** Submits a natural language query to the Adaptive Graph of Thoughts ASR-GoT engine for processing through its 8-stage pipeline.
* **Parameters:** See `MCPASRGoTQueryParams` in `src/adaptive_graph_of_thoughts/api/schemas.py`. This includes:
* `query` (str): The main query string.
* `session_id` (Optional\[str]): An optional session identifier.
* `parameters` (Optional\[`ASRGoTQueryExecutionParams`]): Parameters to control query execution, such as:
* `include_reasoning_trace` (bool): Whether to include a summary of stage outputs.
* `include_graph_state` (bool): Whether to include the full graph state in the response.
* Other operational parameters specific to ASR-GoT stages.
* `context` (Optional\[`ASRGoTQueryContext`]): Optional initial context for the query.
* **Returns:** `MCPASRGoTQueryResult` (see `src/adaptive_graph_of_thoughts/api/schemas.py`). This includes:
* `answer` (str): The final answer generated by the pipeline.
* `reasoning_trace_summary` (Optional\[str]): A summary of the reasoning steps if requested.
* `graph_state_full` (Optional\[`GraphStateSchema`]): The full graph state if requested.
* `confidence_vector` (Optional\[list\[float]]): The final confidence assessment.
* `session_id` (str): The session ID for this query-response cycle.
* `execution_time_ms` (int): The total processing time for the query.
### `shutdown`
* **Description:** Signals the server that the client session is ending and the server can prepare for shutdown or resource cleanup if necessary.
* **Parameters:** See `ShutdownParams` in `src/adaptive_graph_of_thoughts/api/schemas.py`.
* **Returns:** `None`.
*Further details on request/response schemas can be found by examining the Pydantic models in `src/adaptive_graph_of_thoughts/api/schemas.py`.*