* chore: fill out missing metadata inputs in python sdk * feat: add get_peer_config to python sdk, thoroughly document ts sdk and remove bad client usage * feat: zod chore: update tests chore: bump version, changelog * chore: python sdk version bump and changelog * [WIP] feat: combine search methods and rework endpoint to include limit param * chore: test new stainless config with library * nits: coderabbit * Merge branch 'ben/sdk-improvements' into ben/search-rrf * chore: pre-commit hooks cleanup * feat: thoroughly document observation config * Update sdks/python/src/honcho/peer.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: v1.3.0 * feat: update version to 2.2.0 and enhance search functionality with arbitrary filters - Remove unused config variables - Added arbitrary filters to all search endpoints. - Pluralize `filters` everywhere in SDKs for consistency - Updated documentation and changelog to reflect these changes. * expose core client in TS and Python SDKs (#150) * expose core client from sdks * align text * fix: resolve get_effective_observe me race condition, default peer config (#176) * fix: resolve get_effective_observe me race condition, default peer config * fix: preserve custom config even after leaving * chore: test cases, enqueue types * Update sdks/typescript/package.json Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: doria <93405247+dr-frmr@users.noreply.github.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: formatting * chore: revert undesired changes to v1 spec, clean up docs, coderabbit * feat: better search docs, fix worker.ts * fix: correctly make ts params optional in cases, update docs * chore: coderabbit * chore: remove spurious package-lock * fix: asyncify examples, use limit properly in search * fix(tests): handle 4 return values in test_get_session_peer_configuration --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Rajat Ahuja <rahuja445@gmail.com> |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| README.md | ||
| bun.lock | ||
| instructions.md | ||
| package.json | ||
| tsconfig.json | ||
| worker.ts | ||
| wrangler.toml | ||
README.md
Honcho MCP Server
Quickstart: Use the Hosted MCP Server
Go to https://app.honcho.dev and get an API key. Then go to Claude Desktop and navigate to custom MCP servers.
If you don't have node/bun installed you will need to do that. You can also use npm if you already have that installed. If not, Claude Desktop or Claude Code can help!
Add Honcho to your Claude desktop config. You must provide a username for Honcho to refer to you as -- preferably what you want Claude to actually call you.
{
"mcpServers": {
"honcho": {
"command": "bunx",
"args": [
"mcp-remote",
"https://mcp.honcho.dev",
"--header",
"Authorization:${AUTH_HEADER}",
"--header",
"X-Honcho-User-Name:${USER_NAME}"
],
"env": {
"AUTH_HEADER": "Bearer <your-honcho-key>",
"USER_NAME": "<your-name>"
}
}
}
}
You may customize your assistant name and/or workspace ID. Both are optional.
{
"mcpServers": {
"honcho": {
"command": "bunx",
"args": [
"mcp-remote",
"https://mcp.honcho.dev",
"--header",
"Authorization:${AUTH_HEADER}",
"--header",
"X-Honcho-User-Name:${USER_NAME}",
"--header",
"X-Honcho-Assistant-Name:${ASSISTANT_NAME}",
"--header",
"X-Honcho-Workspace-ID:${WORKSPACE_ID}"
],
"env": {
"AUTH_HEADER": "Bearer <your-honcho-key>",
"USER_NAME": "<your-name>",
"ASSISTANT_NAME": "<your-assistant-name>",
"WORKSPACE_ID": "<your-custom-workspace-id>"
}
}
}
}
Available Tools
start_conversation
Start a new conversation session with Honcho. This initializes a session for tracking conversation history and context.
Returns: A session ID that you must store and use for all subsequent interactions in this conversation.
add_turn
Add a conversation turn (user and assistant messages) to the current session. This stores the conversation in Honcho for context tracking.
Parameters:
session_id: The ID of the session to add the turn tomessages: Array of message objects withrole("user" or "assistant") andcontent
Example usage:
{
"session_id": "session-uuid",
"messages": [
{
"role": "user",
"content": "Hello, how are you?"
},
{
"role": "assistant",
"content": "I'm doing well, thank you!"
}
]
}
get_personalization_insights
Get personalization insights from Honcho based on conversation history. This queries the user's conversation context to provide personalized responses.
Parameters:
session_id: The ID of the session for contextquery: The question about the user's preferences, habits, etc.
Example queries:
- "What does this message reveal about the user's communication preferences?"
- "How formal or casual should I be with the user based on our history?"
- "What emotional state might the user be in right now?"
search_workspace
Search for messages across the entire workspace.
Parameters:
query: The search query to use
get_workspace_metadata
Get metadata for the current workspace.
Parameters: None
set_workspace_metadata
Set metadata for the current workspace.
Parameters:
metadata: A dictionary of metadata to associate with the workspace
create_peer
Create or get a peer with the specified ID and optional configuration.
Parameters:
peer_id: Unique identifier for the peerconfig: Optional configuration dictionary for the peer
get_peer_metadata
Get metadata for a specific peer.
Parameters:
peer_id: The ID of the peer to get metadata for
set_peer_metadata
Set metadata for a specific peer.
Parameters:
peer_id: The ID of the peer to set metadata formetadata: A dictionary of metadata to associate with the peer
search_peer_messages
Search for messages sent by a peer.
Parameters:
peer_id: The ID of the peer to search messages forquery: The search query to use
chat
Query a peer's representation with natural language questions.
Parameters:
peer_id: The ID of the peer to queryquery: The natural language question to asktarget_peer_id: Optional target peer ID for local representation queriessession_id: Optional session ID to scope the query to a specific session
list_peers
Get all peers in the current workspace.
Parameters: None
create_session
Create or get a session with the specified ID and optional configuration.
Parameters:
session_id: Unique identifier for the sessionconfig: Optional configuration dictionary for the session
get_session_metadata
Get metadata for a specific session.
Parameters:
session_id: The ID of the session to get metadata for
set_session_metadata
Set metadata for a specific session.
Parameters:
session_id: The ID of the session to set metadata formetadata: A dictionary of metadata to associate with the session
add_peers_to_session
Add peers to a session.
Parameters:
session_id: The ID of the session to add peers topeer_ids: List of peer IDs to add to the session
remove_peers_from_session
Remove peers from a session.
Parameters:
session_id: The ID of the session to remove peers frompeer_ids: List of peer IDs to remove from the session
get_session_peers
Get all peer IDs in a session.
Parameters:
session_id: The ID of the session to get peers from
add_messages_to_session
Add messages to a session.
Parameters:
session_id: The ID of the session to add messages tomessages: List of message dictionaries withpeer_id,content, and optionalmetadata
get_session_messages
Get messages from a session with optional filtering.
Parameters:
session_id: The ID of the session to get messages fromfilters: Optional dictionary of filter criteria
get_session_context
Get optimized context for a session within a token limit.
Parameters:
session_id: The ID of the session to get context forsummary: Whether to include summary information (default: true)tokens: Maximum number of tokens to include in the context
search_session_messages
Search for messages in a specific session.
Parameters:
session_id: The ID of the session to search messages inquery: The search query to use
get_working_representation
Get the current working representation of a peer in a session.
Parameters:
session_id: The ID of the sessionpeer_id: The ID of the peer to get the working representation oftarget_peer_id: Optional target peer ID to get the representation of what peer_id knows about target_peer_id
list_sessions
Get all sessions in the current workspace.
Parameters: None
Contributing or Self Hosting
A Cloudflare Worker that implements the Model Context Protocol (MCP) to provide Honcho functionality as tools for AI assistants like Claude Desktop.
Deploy MCP Worker
-
Install dependencies:
bun i -
Login to Cloudflare (if not already done):
bun wrangler login -
Configure your worker name in
wrangler.toml:- Update the
namefield to your desired worker name - Update the worker names in the
[env.production]and[env.staging]sections
- Update the
-
Test locally:
bun dev -
Deploy to production:
bun run deploy
Configuration Options
You can customize the behavior using HTTP headers:
Available Configuration:
apiKey: Your Honcho API keybaseUrl: Custom Honcho API base URL (default: https://api.honcho.dev)workspaceId: Workspace ID (default: "default")userName: User identifier (default: "User")assistantName: Assistant identifier (default: "Assistant")
Using HTTP Headers
Pass configuration to mcp-remote via custom headers:
bunx mcp-remote https://YOUR_WORKER_NAME.YOUR_SUBDOMAIN.workers.dev \
--header "Authorization:Bearer YOUR_HONCHO_API_KEY" \
--header "X-Honcho-Workspace-ID:my-workspace" \
--header "X-Honcho-User-Name:john" \
--header "X-Honcho-Assistant-Name:Claude" \
--header "X-Honcho-Base-URL:https://custom.honcho.dev"
Supported Custom Headers:
Authorization: Bearer YOUR_API_KEY- Your Honcho API keyX-Honcho-Base-URL- Custom Honcho API base URLX-Honcho-Workspace-ID- Workspace identifierX-Honcho-User-Name- User identifierX-Honcho-Assistant-Name- Assistant identifier
Authentication
The MCP server requires a valid Honcho API key provided via the Authorization header.
Testing
You can test the MCP server using mcp-remote with the local URL:
bunx mcp-remote http://localhost:8787 --header "Authorization:Bearer your-api-key"
Error Handling
The server provides proper JSON-RPC 2.0 error responses:
-32700: Parse error-32600: Invalid Request-32601: Method not found-32602: Invalid params-32603: Internal error
Common issues:
- Missing API key: Ensure you provide a valid Honcho API key via header or URL parameter
- Invalid tool parameters: Check that required parameters are provided and properly formatted
- Network errors: Verify the worker is deployed and accessible