### Zread MCP SSE Endpoint Example Source: https://zread.ai/mcp/index Example URL for accessing Zread MCP via Server-Sent Events (SSE). This method adheres to the official MCP specification and is recommended for most IDEs and clients that support MCP. ```bash https://api.z.ai/api/mcp/zread/sse?Authorization=zai_api_key ``` -------------------------------- ### Search Documentation Tool (search_doc) Source: https://zread.ai/mcp/index The `search_doc` tool facilitates searches within a GitHub repository's documentation to understand its purpose, setup, core modules, and workflows. It can also retrieve information on related news, issues, commits, and contributors. -------------------------------- ### Zread MCP Streamable HTTP Endpoint Example Source: https://zread.ai/mcp/index Example URL for accessing Zread MCP via Streamable HTTP. This method is adapted for clients that support HTTP streaming MCP, such as some self-built Agents or OpenAI compatible implementations. ```bash https://api.z.ai/api/mcp/zread/mcp ``` -------------------------------- ### Add Zread MCP Server via Claude Code CLI (Bash) Source: https://zread.ai/mcp/index Use this command in the Claude Code CLI to add the Zread MCP server to your configuration. Replace `zai_api_key` with your actual API key. ```bash claude mcp add -s user -t http zread https://api.z.ai/api/mcp/zread/mcp --header "Authorization: Bearer zai_api_key" ``` -------------------------------- ### Available Zread MCP Tools Source: https://zread.ai/mcp/index Zread MCP offers three atomic tools for code understanding and retrieval: `search_doc`, `get_repo_structure`, and `read_file`. ```APIDOC ## Zread MCP Tools ### `search_doc` #### Description Performs searches within the documentation of a GitHub repository to help understand repository purpose, setup, core modules, workflows, and related news or contributors. #### Parameters - **repo_url** (string) - Required - The URL of the GitHub repository. - **query** (string) - Required - The search query string. ### `get_repo_structure` #### Description Views the structure of a GitHub repository or subdirectory, allowing the model to understand project hierarchy and module organization. #### Parameters - **repo_url** (string) - Required - The URL of the GitHub repository. - **path** (string) - Optional - The subdirectory path within the repository to explore. ### `read_file` #### Description Reads the full content of a single file in a GitHub repository, used for reviewing implementation details, code analysis, or refactoring suggestions. #### Parameters - **repo_url** (string) - Required - The URL of the GitHub repository. - **file_path** (string) - Required - The path to the file within the repository. ``` -------------------------------- ### Zread MCP SSE Endpoint Source: https://zread.ai/mcp/index The SSE (Server-Sent Events) endpoint adheres to the official MCP recommended specification and is suitable for most IDEs/Clients that support MCP. This is the recommended method for priority use. ```APIDOC ## Zread MCP SSE Endpoint ### Description This endpoint allows clients to communicate with Zread MCP using Server-Sent Events, following the official MCP specification. It's ideal for IDEs and clients that support MCP. ### Method POST (or other methods as supported by MCP clients) ### Endpoint `/api/mcp/zread/sse` ### Query Parameters - **Authorization** (string) - Required - Your ZAI API key for authentication. ### Request Body Refer to the MCP specification for the exact request body format, which typically includes the tool to be called and its parameters. ### Request Example ```json { "tool_code": "search_doc", "parameters": { "repo_url": "https://github.com/example/repo", "query": "how to install" } } ``` ### Response #### Success Response (200) The response will be a stream of Server-Sent Events containing the results from the requested tool. #### Response Example ``` event: tool_code data: {"tool_code": "search_doc"} event: message data: {"content": "Installation instructions can be found in the README file. Run `npm install`."} ``` ``` -------------------------------- ### Zread MCP Server Configuration Source: https://zread.ai/mcp/index Configuration for the Zread MCP server, specifying the type, URL, and authorization headers for the 'zread' service. ```json { "mcpServers": { "zread": { "type": "streamableHttp", "url": "https://api.z.ai/api/mcp/zread/mcp", "headers": { "Authorization": "Bearer zai_api_key" } } } } ``` -------------------------------- ### Zread MCP Streamable HTTP Endpoint Source: https://zread.ai/mcp/index The Streamable HTTP endpoint is adapted for clients that support HTTP streaming MCP, such as some self-built Agents or OpenAI compatible implementations. ```APIDOC ## Zread MCP Streamable HTTP Endpoint ### Description This endpoint provides Zread MCP capabilities via HTTP streaming, suitable for custom agents or OpenAI compatible clients. ### Method POST (or other methods as supported by MCP clients) ### Endpoint `/api/mcp/zread/mcp` ### Headers - **Authorization** (string) - Required - Your ZAI API key for authentication. ### Request Body Refer to the MCP specification for the exact request body format, which typically includes the tool to be called and its parameters. ### Request Example ```json { "tool_code": "get_repo_structure", "parameters": { "repo_url": "https://github.com/example/repo" } } ``` ### Response #### Success Response (200) The response will be a stream of data chunks representing the results from the requested tool. #### Response Example ```json { "tool_code": "get_repo_structure", "output": "{\"dir_name\": \"repo\", \"children\": [{\"dir_name\": \"src\"}, {\"file_name\": \"README.md\"}]}" } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.