Skip to content

Commit 5aa93e0

Browse files
chore(mcp)!: remove deprecated tool schemes
This removes all tool schemes except for "code mode" tools. Specifically, this removes "all tools" and "dynamic tools" schemes. Additionally, this removes support for resource filtering, tags, jq filtering, and compatibility controls in MCP servers, as they are no longer necessary when using code mode. # Migration To migrate, simply modify the command used to invoke the MCP server. Currently, the only supported tool scheme is code mode. Now, starting the server with just `node /path/to/mcp/server` or `npx package-name` will invoke code tools: changing your command to one of these is likely all you will need to do. Specifically, you must remove all flags including things like --resources, --tags, --client, --tools=dynamic, etc from your invocation command. The only supported flags are now `--port`, `--transport`, `--socket`, and `--tools=docs` (specifically for "docs"). These are also the only options available for http servers. migration-effort: small
1 parent 5cb1499 commit 5aa93e0

28 files changed

+51
-4689
lines changed

packages/mcp-server/Dockerfile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,6 @@
3939

4040
# Production stage
4141

42-
FROM denoland/deno:alpine
43-
RUN apk add --no-cache npm
44-
4542
# Add non-root user
4643
RUN addgroup -g 1001 -S nodejs && adduser -S nodejs -u 1001
4744

@@ -66,10 +63,6 @@ COPY --from=builder /build/packages/mcp-server/node_modules ./node_modules
6663
# The MCP server uses stdio transport by default
6764
# No exposed ports needed for stdio communication
6865

69-
# This is needed for node to run on the deno:alpine image.
70-
# See <https://github.com/denoland/deno_docker/issues/373>.
71-
ENV LD_LIBRARY_PATH=/usr/lib:/usr/local/lib
72-
7366
# Set the entrypoint to the MCP server
7467
ENTRYPOINT ["node", "index.js"]
7568

packages/mcp-server/README.md

Lines changed: 13 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ For clients with a configuration JSON, it might look something like this:
2626
"mcpServers": {
2727
"hyperspell_api": {
2828
"command": "npx",
29-
"args": ["-y", "hyperspell-mcp", "--client=claude", "--tools=all"],
29+
"args": ["-y", "hyperspell-mcp"],
3030
"env": {
3131
"HYPERSPELL_API_KEY": "My API Key",
3232
"HYPERSPELL_USER_ID": "My User ID"
@@ -59,110 +59,22 @@ environment variables in Claude Code's `.claude.json`, which can be found in you
5959
claude mcp add --transport stdio hyperspell_api --env HYPERSPELL_API_KEY="Your HYPERSPELL_API_KEY here." HYPERSPELL_USER_ID="Your HYPERSPELL_USER_ID here." -- npx -y hyperspell-mcp
6060
```
6161

62-
## Exposing endpoints to your MCP Client
62+
## Code Mode
6363

64-
There are three ways to expose endpoints as tools in the MCP server:
64+
This MCP server is built on the "Code Mode" tool scheme. In this MCP Server,
65+
your agent will write code against the TypeScript SDK, which will then be executed in an
66+
isolated sandbox. To accomplish this, the server will expose two tools to your agent:
6567

66-
1. Exposing one tool per endpoint, and filtering as necessary
67-
2. Exposing a set of tools to dynamically discover and invoke endpoints from the API
68-
3. Exposing a docs search tool and a code execution tool, allowing the client to write code to be executed against the TypeScript client
68+
- The first tool is a docs search tool, which can be used to generically query for
69+
documentation about your API/SDK.
6970

70-
### Filtering endpoints and tools
71+
- The second tool is a code tool, where the agent can write code against the TypeScript SDK.
72+
The code will be executed in a sandbox environment without web or filesystem access. Then,
73+
anything the code returns or prints will be returned to the agent as the result of the
74+
tool call.
7175

72-
You can run the package on the command line to discover and filter the set of tools that are exposed by the
73-
MCP Server. This can be helpful for large APIs where including all endpoints at once is too much for your AI's
74-
context window.
75-
76-
You can filter by multiple aspects:
77-
78-
- `--tool` includes a specific tool by name
79-
- `--resource` includes all tools under a specific resource, and can have wildcards, e.g. `my.resource*`
80-
- `--operation` includes just read (get/list) or just write operations
81-
82-
### Dynamic tools
83-
84-
If you specify `--tools=dynamic` to the MCP server, instead of exposing one tool per endpoint in the API, it will
85-
expose the following tools:
86-
87-
1. `list_api_endpoints` - Discovers available endpoints, with optional filtering by search query
88-
2. `get_api_endpoint_schema` - Gets detailed schema information for a specific endpoint
89-
3. `invoke_api_endpoint` - Executes any endpoint with the appropriate parameters
90-
91-
This allows you to have the full set of API endpoints available to your MCP Client, while not requiring that all
92-
of their schemas be loaded into context at once. Instead, the LLM will automatically use these tools together to
93-
search for, look up, and invoke endpoints dynamically. However, due to the indirect nature of the schemas, it
94-
can struggle to provide the correct properties a bit more than when tools are imported explicitly. Therefore,
95-
you can opt-in to explicit tools, the dynamic tools, or both.
96-
97-
See more information with `--help`.
98-
99-
All of these command-line options can be repeated, combined together, and have corresponding exclusion versions (e.g. `--no-tool`).
100-
101-
Use `--list` to see the list of available tools, or see below.
102-
103-
### Code execution
104-
105-
If you specify `--tools=code` to the MCP server, it will expose just two tools:
106-
107-
- `search_docs` - Searches the API documentation and returns a list of markdown results
108-
- `execute` - Runs code against the TypeScript client
109-
110-
This allows the LLM to implement more complex logic by chaining together many API calls without loading
111-
intermediary results into its context window.
112-
113-
The code execution itself happens in a Deno sandbox that has network access only to the base URL for the API.
114-
115-
### Specifying the MCP Client
116-
117-
Different clients have varying abilities to handle arbitrary tools and schemas.
118-
119-
You can specify the client you are using with the `--client` argument, and the MCP server will automatically
120-
serve tools and schemas that are more compatible with that client.
121-
122-
- `--client=<type>`: Set all capabilities based on a known MCP client
123-
124-
- Valid values: `openai-agents`, `claude`, `claude-code`, `cursor`
125-
- Example: `--client=cursor`
126-
127-
Additionally, if you have a client not on the above list, or the client has gotten better
128-
over time, you can manually enable or disable certain capabilities:
129-
130-
- `--capability=<name>`: Specify individual client capabilities
131-
- Available capabilities:
132-
- `top-level-unions`: Enable support for top-level unions in tool schemas
133-
- `valid-json`: Enable JSON string parsing for arguments
134-
- `refs`: Enable support for $ref pointers in schemas
135-
- `unions`: Enable support for union types (anyOf) in schemas
136-
- `formats`: Enable support for format validations in schemas (e.g. date-time, email)
137-
- `tool-name-length=N`: Set maximum tool name length to N characters
138-
- Example: `--capability=top-level-unions --capability=tool-name-length=40`
139-
- Example: `--capability=top-level-unions,tool-name-length=40`
140-
141-
### Examples
142-
143-
1. Filter for read operations on cards:
144-
145-
```bash
146-
--resource=cards --operation=read
147-
```
148-
149-
2. Exclude specific tools while including others:
150-
151-
```bash
152-
--resource=cards --no-tool=create_cards
153-
```
154-
155-
3. Configure for Cursor client with custom max tool name length:
156-
157-
```bash
158-
--client=cursor --capability=tool-name-length=40
159-
```
160-
161-
4. Complex filtering with multiple criteria:
162-
163-
```bash
164-
--resource=cards,accounts --operation=read --tag=kyc --no-tool=create_cards
165-
```
76+
Using this scheme, agents are capable of performing very complex tasks deterministically
77+
and repeatably.
16678

16779
## Running remotely
16880

@@ -190,76 +102,3 @@ A configuration JSON for this server might look like this, assuming the server i
190102
}
191103
}
192104
```
193-
194-
The command-line arguments for filtering tools and specifying clients can also be used as query parameters in the URL.
195-
For example, to exclude specific tools while including others, use the URL:
196-
197-
```
198-
http://localhost:3000?resource=cards&resource=accounts&no_tool=create_cards
199-
```
200-
201-
Or, to configure for the Cursor client, with a custom max tool name length, use the URL:
202-
203-
```
204-
http://localhost:3000?client=cursor&capability=tool-name-length%3D40
205-
```
206-
207-
## Importing the tools and server individually
208-
209-
```js
210-
// Import the server, generated endpoints, or the init function
211-
import { server, endpoints, init } from "hyperspell-mcp/server";
212-
213-
// import a specific tool
214-
import listConnections from "hyperspell-mcp/tools/connections/list-connections";
215-
216-
// initialize the server and all endpoints
217-
init({ server, endpoints });
218-
219-
// manually start server
220-
const transport = new StdioServerTransport();
221-
await server.connect(transport);
222-
223-
// or initialize your own server with specific tools
224-
const myServer = new McpServer(...);
225-
226-
// define your own endpoint
227-
const myCustomEndpoint = {
228-
tool: {
229-
name: 'my_custom_tool',
230-
description: 'My custom tool',
231-
inputSchema: zodToJsonSchema(z.object({ a_property: z.string() })),
232-
},
233-
handler: async (client: client, args: any) => {
234-
return { myResponse: 'Hello world!' };
235-
})
236-
};
237-
238-
// initialize the server with your custom endpoints
239-
init({ server: myServer, endpoints: [listConnections, myCustomEndpoint] });
240-
```
241-
242-
## Available Tools
243-
244-
The following tools are available in this MCP server.
245-
246-
### Resource `connections`:
247-
248-
- `list_connections` (`read`): Get accounts the user has connected
249-
250-
### Resource `integrations`:
251-
252-
- `list_integrations` (`read`): List all available integrations
253-
- `connect_integration` (`read`): Get a signed url to connect to a given integration. Use the `list_integrations` tool to find the correct `integration_id` for the required provider.
254-
255-
### Resource `memories`:
256-
257-
- `update_memory` (`write`): This tool lets you update memory in Hyperspell.
258-
- `add_memory` (`write`): This tool lets you add text, markdown, or JSON to the Hyperspell index so it can be searched later. It will return the `source` and `resource_id` that can be used to later retrieve the processed memory.
259-
- `get_memory` (`read`): This tool lets you retrieve a memory that has been previously indexed.
260-
- `search` (`write`): Search all memories indexed by Hyperspell. Set 'answer' to true to directly answer the query, or to 'false' to simply get all memories related to the query.
261-
- `upload_file` (`write`): This tool lets you upload a file to the Hyperspell index. It will return the `source` and `resource_id` that can be used to later retrieve the processed memory.
262-
263-
### Resource `auth`:
264-
265-
- `user_info` (`read`): Get basic info about the current user, including which integrations are currently enabled and which ones are available.

packages/mcp-server/src/code-tool.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
import { Metadata, ToolCallResult, asTextContentResult } from './tools/types';
3+
import { McpTool, Metadata, ToolCallResult, asTextContentResult } from './types';
44
import { Tool } from '@modelcontextprotocol/sdk/types.js';
55
import { readEnv } from './server';
66
import { WorkerSuccess } from './code-tool-types';
@@ -13,7 +13,7 @@ import { WorkerSuccess } from './code-tool-types';
1313
*
1414
* @param endpoints - The endpoints to include in the list.
1515
*/
16-
export async function codeTool() {
16+
export function codeTool(): McpTool {
1717
const metadata: Metadata = { resource: 'all', operation: 'write', tags: [] };
1818
const tool: Tool = {
1919
name: 'execute',

0 commit comments

Comments
 (0)