From 7275b4c64b8a35b254209d38177748e9c2942e05 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 4 Apr 2025 07:25:41 +0000 Subject: [PATCH] docs(mcp): improve MCP readme docs --- packages/mcp-server/README.md | 58 ++++++++++++++++++++++++++++------- 1 file changed, 47 insertions(+), 11 deletions(-) diff --git a/packages/mcp-server/README.md b/packages/mcp-server/README.md index a43bc6a..5402582 100644 --- a/packages/mcp-server/README.md +++ b/packages/mcp-server/README.md @@ -4,16 +4,21 @@ It is generated with [Stainless](https://www.stainless.com/). ## Installation -### Via Claude Desktop +### Direct invocation -See [the user guide](https://modelcontextprotocol.io/quickstart/user) for setup. +You can run the MCP Server directly via `npx`: -Once it's set up, find your `claude_desktop_config.json` file: +```sh +export ISAACUS_API_KEY = "My API Key" +npx -y isaacus-mcp +``` -- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json` -- Windows: `%APPDATA%\Claude\claude_desktop_config.json` +### Via MCP Client -Add the following value to your `mcpServers` section. Make sure to provide any necessary environment variables (like API keys) as well. +There is a partial list of existing clients at [modelcontextprotocol.io](https://modelcontextprotocol.io/clients). If you already +have a client, consult their documentation to install the MCP server. + +For clients with a configuration JSON, it might look something like this: ```json { @@ -41,16 +46,47 @@ You can filter by multiple aspects: - `--resource` includes all tools under a specific resource, and can have wildcards, e.g. `my.resource*` - `--operation` includes just read (get/list) or just write operations -See more information with `--help`: - -```sh -$ npx -y isaacus-mcp --help -``` +See more information with `--help`. All of these command-line options can be repeated, combined together, and have corresponding exclusion versions (e.g. `--no-tool`). Use `--list` to see the list of available tools, or see below. +## Importing the tools and server individually + +```js +// Import the server, generated endpoints, or the init function +import { server, endpoints, init } from "isaacus-mcp/server"; + +// import a specific tool +import createClassificationsUniversal from "isaacus-mcp/tools/classifications/universal/create-classifications-universal"; + +// initialize the server and all endpoints +init({ server, endpoints }); + +// manually start server +const transport = new StdioServerTransport(); +await server.connect(transport); + +// or initialize your own server with specific tools +const myServer = new McpServer(...); + +// define your own endpoint +const myCustomEndpoint = { + tool: { + name: 'my_custom_tool', + description: 'My custom tool', + inputSchema: zodToJsonSchema(z.object({ a_property: z.string() })), + }, + handler: async (client: client, args: any) => { + return { myResponse: 'Hello world!' }; + }) +}; + +// initialize the server with your custom endpoints +init({ server: myServer, endpoints: [createClassificationsUniversal, myCustomEndpoint] }); +``` + ## Available Tools The following tools are available in this MCP server.