Skip to content

Commit 9b1ff85

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 f220343 commit 9b1ff85

File tree

64 files changed

+51
-7775
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+51
-7775
lines changed

packages/mcp-server/README.md

Lines changed: 13 additions & 301 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ For clients with a configuration JSON, it might look something like this:
2828
"mcpServers": {
2929
"tryfinch_finch_api_api": {
3030
"command": "npx",
31-
"args": ["-y", "@tryfinch/finch-api-mcp", "--client=claude", "--tools=dynamic"],
31+
"args": ["-y", "@tryfinch/finch-api-mcp"],
3232
"env": {
3333
"FINCH_ACCESS_TOKEN": "My Access Token",
3434
"FINCH_CLIENT_ID": "4ab15e51-11ad-49f4-acae-f343b7794375",
@@ -63,110 +63,22 @@ environment variables in Claude Code's `.claude.json`, which can be found in you
6363
claude mcp add --transport stdio tryfinch_finch_api_api --env FINCH_ACCESS_TOKEN="Your FINCH_ACCESS_TOKEN here." FINCH_CLIENT_ID="Your FINCH_CLIENT_ID here." FINCH_CLIENT_SECRET="Your FINCH_CLIENT_SECRET here." FINCH_WEBHOOK_SECRET="Your FINCH_WEBHOOK_SECRET here." -- npx -y @tryfinch/finch-api-mcp
6464
```
6565

66-
## Exposing endpoints to your MCP Client
66+
## Code Mode
6767

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

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

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

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

17183
## Running remotely
17284

@@ -194,203 +106,3 @@ A configuration JSON for this server might look like this, assuming the server i
194106
}
195107
}
196108
```
197-
198-
The command-line arguments for filtering tools and specifying clients can also be used as query parameters in the URL.
199-
For example, to exclude specific tools while including others, use the URL:
200-
201-
```
202-
http://localhost:3000?resource=cards&resource=accounts&no_tool=create_cards
203-
```
204-
205-
Or, to configure for the Cursor client, with a custom max tool name length, use the URL:
206-
207-
```
208-
http://localhost:3000?client=cursor&capability=tool-name-length%3D40
209-
```
210-
211-
## Importing the tools and server individually
212-
213-
```js
214-
// Import the server, generated endpoints, or the init function
215-
import { server, endpoints, init } from "@tryfinch/finch-api-mcp/server";
216-
217-
// import a specific tool
218-
import createAccessTokens from "@tryfinch/finch-api-mcp/tools/access-tokens/create-access-tokens";
219-
220-
// initialize the server and all endpoints
221-
init({ server, endpoints });
222-
223-
// manually start server
224-
const transport = new StdioServerTransport();
225-
await server.connect(transport);
226-
227-
// or initialize your own server with specific tools
228-
const myServer = new McpServer(...);
229-
230-
// define your own endpoint
231-
const myCustomEndpoint = {
232-
tool: {
233-
name: 'my_custom_tool',
234-
description: 'My custom tool',
235-
inputSchema: zodToJsonSchema(z.object({ a_property: z.string() })),
236-
},
237-
handler: async (client: client, args: any) => {
238-
return { myResponse: 'Hello world!' };
239-
})
240-
};
241-
242-
// initialize the server with your custom endpoints
243-
init({ server: myServer, endpoints: [createAccessTokens, myCustomEndpoint] });
244-
```
245-
246-
## Available Tools
247-
248-
The following tools are available in this MCP server.
249-
250-
### Resource `access_tokens`:
251-
252-
- `create_access_tokens` (`write`): Exchange the authorization code for an access token
253-
254-
### Resource `hris.company`:
255-
256-
- `retrieve_hris_company` (`read`): Read basic company data
257-
258-
### Resource `hris.company.pay_statement_item`:
259-
260-
- `list_company_hris_pay_statement_item` (`read`): **Beta:** this endpoint currently serves employers onboarded after March 4th and historical support will be added soon
261-
Retrieve a list of detailed pay statement items for the access token's connection account.
262-
263-
### Resource `hris.company.pay_statement_item.rules`:
264-
265-
- `create_pay_statement_item_company_hris_rules` (`write`): **Beta:** this endpoint currently serves employers onboarded after March 4th and historical support will be added soon
266-
Custom rules can be created to associate specific attributes to pay statement items depending on the use case. For example, pay statement items that meet certain conditions can be labeled as a pre-tax 401k. This metadata can be retrieved where pay statement item information is available.
267-
- `update_pay_statement_item_company_hris_rules` (`write`): **Beta:** this endpoint currently serves employers onboarded after March 4th and historical support will be added soon
268-
Update a rule for a pay statement item.
269-
- `list_pay_statement_item_company_hris_rules` (`read`): **Beta:** this endpoint currently serves employers onboarded after March 4th and historical support will be added soon
270-
List all rules of a connection account.
271-
- `delete_pay_statement_item_company_hris_rules` (`write`): **Beta:** this endpoint currently serves employers onboarded after March 4th and historical support will be added soon
272-
Delete a rule for a pay statement item.
273-
274-
### Resource `hris.directory`:
275-
276-
- `list_hris_directory` (`read`): Read company directory and organization structure
277-
278-
### Resource `hris.individuals`:
279-
280-
- `retrieve_many_hris_individuals` (`write`): Read individual data, excluding income and employment data
281-
282-
### Resource `hris.employments`:
283-
284-
- `retrieve_many_hris_employments` (`write`): Read individual employment and income data
285-
286-
### Resource `hris.payments`:
287-
288-
- `list_hris_payments` (`read`): Read payroll and contractor related payments by the company.
289-
290-
### Resource `hris.pay_statements`:
291-
292-
- `retrieve_many_hris_pay_statements` (`write`): Read detailed pay statements for each individual.
293-
294-
Deduction and contribution types are supported by the payroll systems that supports Benefits.
295-
296-
### Resource `hris.documents`:
297-
298-
- `list_hris_documents` (`read`): **Beta:** This endpoint is in beta and may change.
299-
Retrieve a list of company-wide documents.
300-
- `retreive_hris_documents` (`read`): **Beta:** This endpoint is in beta and may change.
301-
Retrieve details of a specific document by its ID.
302-
303-
### Resource `hris.benefits`:
304-
305-
- `create_hris_benefits` (`write`): Creates a new company-wide deduction or contribution. Please use the `/providers` endpoint to view available types for each provider.
306-
- `retrieve_hris_benefits` (`read`): Lists deductions and contributions information for a given item
307-
- `update_hris_benefits` (`write`): Updates an existing company-wide deduction or contribution
308-
- `list_hris_benefits` (`read`): List all company-wide deductions and contributions.
309-
- `list_supported_benefits_hris_benefits` (`read`): Get deductions metadata
310-
311-
### Resource `hris.benefits.individuals`:
312-
313-
- `enroll_many_benefits_hris_individuals` (`write`): Enroll an individual into a deduction or contribution. This is an overwrite operation. If the employee is already enrolled, the enrollment amounts will be adjusted. Making the same request multiple times will not create new enrollments, but will continue to set the state of the existing enrollment.
314-
- `enrolled_ids_benefits_hris_individuals` (`read`): Lists individuals currently enrolled in a given deduction.
315-
- `retrieve_many_benefits_benefits_hris_individuals` (`read`): Get enrollment information for the given individuals.
316-
- `unenroll_many_benefits_hris_individuals` (`write`): Unenroll individuals from a deduction or contribution
317-
318-
### Resource `providers`:
319-
320-
- `list_providers` (`read`): Return details on all available payroll and HR systems.
321-
322-
### Resource `account`:
323-
324-
- `disconnect_account` (`write`): Disconnect one or more `access_token`s from your application.
325-
- `introspect_account` (`read`): Read account information associated with an `access_token`
326-
327-
### Resource `request_forwarding`:
328-
329-
- `forward_request_forwarding` (`write`): The Forward API allows you to make direct requests to an employment system. If Finch's unified API
330-
doesn't have a data model that cleanly fits your needs, then Forward allows you to push or pull
331-
data models directly against an integration's API.
332-
333-
### Resource `jobs.automated`:
334-
335-
- `create_jobs_automated` (`write`): Enqueue an automated job.
336-
337-
`data_sync_all`: Enqueue a job to re-sync all data for a connection. `data_sync_all` has a concurrency limit of 1 job at a time per connection. This means that if this endpoint is called while a job is already in progress for this connection, Finch will return the `job_id` of the job that is currently in progress. Finch allows a fixed window rate limit of 1 forced refresh per hour per connection.
338-
339-
`w4_form_employee_sync`: Enqueues a job for sync W-4 data for a particular individual, identified by `individual_id`. This feature is currently in beta.
340-
341-
This endpoint is available for _Scale_ tier customers as an add-on. To request access to this endpoint, please contact your Finch account manager.
342-
343-
- `retrieve_jobs_automated` (`read`): Get an automated job by `job_id`.
344-
- `list_jobs_automated` (`read`): Get all automated jobs. Automated jobs are completed by a machine. By default, jobs are sorted in descending order by submission time. For scheduled jobs such as data syncs, only the next scheduled job is shown.
345-
346-
### Resource `jobs.manual`:
347-
348-
- `retrieve_jobs_manual` (`read`): Get a manual job by `job_id`. Manual jobs are completed by a human and include Assisted Benefits jobs.
349-
350-
### Resource `sandbox.connections`:
351-
352-
- `create_sandbox_connections` (`write`): Create a new connection (new company/provider pair) with a new account
353-
354-
### Resource `sandbox.connections.accounts`:
355-
356-
- `create_connections_sandbox_accounts` (`write`): Create a new account for an existing connection (company/provider pair)
357-
- `update_connections_sandbox_accounts` (`write`): Update an existing sandbox account. Change the connection status to understand how the Finch API responds.
358-
359-
### Resource `sandbox.company`:
360-
361-
- `update_sandbox_company` (`write`): Update a sandbox company's data
362-
363-
### Resource `sandbox.directory`:
364-
365-
- `create_sandbox_directory` (`write`): Add new individuals to a sandbox company
366-
367-
### Resource `sandbox.individual`:
368-
369-
- `update_sandbox_individual` (`write`): Update sandbox individual
370-
371-
### Resource `sandbox.employment`:
372-
373-
- `update_sandbox_employment` (`write`): Update sandbox employment
374-
375-
### Resource `sandbox.payment`:
376-
377-
- `create_sandbox_payment` (`write`): Add a new sandbox payment
378-
379-
### Resource `sandbox.jobs`:
380-
381-
- `create_sandbox_jobs` (`write`): Enqueue a new sandbox job
382-
383-
### Resource `sandbox.jobs.configuration`:
384-
385-
- `retrieve_jobs_sandbox_configuration` (`read`): Get configurations for sandbox jobs
386-
- `update_jobs_sandbox_configuration` (`write`): Update configurations for sandbox jobs
387-
388-
### Resource `payroll.pay_groups`:
389-
390-
- `retrieve_payroll_pay_groups` (`read`): Read information from a single pay group
391-
- `list_payroll_pay_groups` (`read`): Read company pay groups and frequencies
392-
393-
### Resource `connect.sessions`:
394-
395-
- `new_connect_sessions` (`write`): Create a new connect session for an employer
396-
- `reauthenticate_connect_sessions` (`write`): Create a new Connect session for reauthenticating an existing connection

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)