honcho-ai-mcp
v0.2.0
Published
The official MCP Server for the Honcho API
Downloads
11
Readme
honcho-ai MCP Server
It is generated with Stainless.
Installation
Direct invocation
You can run the MCP Server directly via npx:
export HONCHO_API_KEY="My API Key"
npx -y honcho-ai-mcp@latestVia MCP Client
There is a partial list of existing clients at modelcontextprotocol.io. 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:
{
"mcpServers": {
"honcho_ai_api": {
"command": "npx",
"args": ["-y", "honcho-ai-mcp", "--client=claude", "--tools=dynamic"],
"env": {
"HONCHO_API_KEY": "My API Key"
}
}
}
}Exposing endpoints to your MCP Client
There are two ways to expose endpoints as tools in the MCP server:
- Exposing one tool per endpoint, and filtering as necessary
- Exposing a set of tools to dynamically discover and invoke endpoints from the API
Filtering endpoints and tools
You can run the package on the command line to discover and filter the set of tools that are exposed by the MCP Server. This can be helpful for large APIs where including all endpoints at once is too much for your AI's context window.
You can filter by multiple aspects:
--toolincludes a specific tool by name--resourceincludes all tools under a specific resource, and can have wildcards, e.g.my.resource*--operationincludes just read (get/list) or just write operations
Dynamic tools
If you specify --tools=dynamic to the MCP server, instead of exposing one tool per endpoint in the API, it will
expose the following tools:
list_api_endpoints- Discovers available endpoints, with optional filtering by search queryget_api_endpoint_schema- Gets detailed schema information for a specific endpointinvoke_api_endpoint- Executes any endpoint with the appropriate parameters
This allows you to have the full set of API endpoints available to your MCP Client, while not requiring that all of their schemas be loaded into context at once. Instead, the LLM will automatically use these tools together to search for, look up, and invoke endpoints dynamically. However, due to the indirect nature of the schemas, it can struggle to provide the correct properties a bit more than when tools are imported explicitly. Therefore, you can opt-in to explicit tools, the dynamic tools, or both.
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.
Specifying the MCP Client
Different clients have varying abilities to handle arbitrary tools and schemas.
You can specify the client you are using with the --client argument, and the MCP server will automatically
serve tools and schemas that are more compatible with that client.
--client=<type>: Set all capabilities based on a known MCP client- Valid values:
openai-agents,claude,claude-code,cursor - Example:
--client=cursor
- Valid values:
Additionally, if you have a client not on the above list, or the client has gotten better over time, you can manually enable or disable certain capabilities:
--capability=<name>: Specify individual client capabilities- Available capabilities:
top-level-unions: Enable support for top-level unions in tool schemasvalid-json: Enable JSON string parsing for argumentsrefs: Enable support for $ref pointers in schemasunions: Enable support for union types (anyOf) in schemasformats: Enable support for format validations in schemas (e.g. date-time, email)tool-name-length=N: Set maximum tool name length to N characters
- Example:
--capability=top-level-unions --capability=tool-name-length=40 - Example:
--capability=top-level-unions,tool-name-length=40
- Available capabilities:
Examples
- Filter for read operations on cards:
--resource=cards --operation=read- Exclude specific tools while including others:
--resource=cards --no-tool=create_cards- Configure for Cursor client with custom max tool name length:
--client=cursor --capability=tool-name-length=40- Complex filtering with multiple criteria:
--resource=cards,accounts --operation=read --tag=kyc --no-tool=create_cardsImporting the tools and server individually
// Import the server, generated endpoints, or the init function
import { server, endpoints, init } from "honcho-ai-mcp/server";
// import a specific tool
import createApps from "honcho-ai-mcp/tools/apps/create-apps";
// 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: [createApps, myCustomEndpoint] });Available Tools
The following tools are available in this MCP server.
Resource apps:
create_apps(write): Create a new Appupdate_apps(write): Update an Applist_apps(write): Get all Appsget_apps(read): Get an App by ID.
If app_id is provided as a query parameter, it uses that (must match JWT app_id). Otherwise, it uses the app_id from the JWT token.
get_by_name_apps(read): Get an App by Nameget_or_create_apps(read): Get or Create an App
Resource apps.users:
create_apps_users(write): Create a new Userupdate_apps_users(write): Update a User's name and/or metadatalist_apps_users(write): Get All Users for an Appget_apps_users(read): Get a User by ID
If user_id is provided as a query parameter, it uses that (must match JWT app_id). Otherwise, it uses the user_id from the JWT token.
get_by_name_apps_users(read): Get a User by nameget_or_create_apps_users(read): Get a User or create a new one by the input name
Resource apps.users.metamessages:
create_users_apps_metamessages(write): Create a new metamessage associated with a user. Optionally link to a session and message by providing those IDs in the request body.update_users_apps_metamessages(write): Update a metamessage's metadata, type, or relationshipslist_users_apps_metamessages(write): Get metamessages with flexible filtering.
- Filter by user only: No additional parameters needed
- Filter by session: Provide session_id
- Filter by message: Provide message_id (and session_id)
- Filter by type: Provide label
- Filter by metadata: Provide filter object
get_users_apps_metamessages(read): Get a specific Metamessage by ID
Resource apps.users.sessions:
create_users_apps_sessions(write): Create a Session for a Userupdate_users_apps_sessions(write): Update the metadata of a Sessionlist_users_apps_sessions(write): Get All Sessions for a Userdelete_users_apps_sessions(write): Delete a session by marking it as inactivechat_users_apps_sessions(write): Chat with the Dialectic APIclone_users_apps_sessions(read): Clone a session, optionally up to a specific messageget_users_apps_sessions(read): Get a specific session for a user.
If session_id is provided as a query parameter, it uses that (must match JWT session_id). Otherwise, it uses the session_id from the JWT token.
Resource apps.users.sessions.messages:
create_sessions_users_apps_messages(write): Adds a message to a sessionupdate_sessions_users_apps_messages(write): Update the metadata of a Messagelist_sessions_users_apps_messages(write): Get all messages for a sessionbatch_sessions_users_apps_messages(write): Bulk create messages for a session while maintaining order. Maximum 100 messages per batch.get_sessions_users_apps_messages(read): Get a Message by ID
Resource apps.users.collections:
create_users_apps_collections(write): Create a new Collectionupdate_users_apps_collections(write): Update a Collection's name or metadatalist_users_apps_collections(write): Get All Collections for a Userdelete_users_apps_collections(write): Delete a Collection and its documentsget_users_apps_collections(read): Get a specific collection for a user.
If collection_id is provided as a query parameter, it uses that (must match JWT collection_id). Otherwise, it uses the collection_id from the JWT token.
get_by_name_users_apps_collections(read): Get a Collection by Name
Resource apps.users.collections.documents:
create_collections_users_apps_documents(write): Embed text as a vector and create a Documentupdate_collections_users_apps_documents(write): Update the content and/or the metadata of a Documentlist_collections_users_apps_documents(write): Get all of the Documents in a Collectiondelete_collections_users_apps_documents(write): Delete a Document by IDget_collections_users_apps_documents(read): Get a document by IDquery_collections_users_apps_documents(write): Cosine Similarity Search for Documents
Resource keys:
create_keys(write): Create a new Key
