MCP Server
Serving your own users
Give each signed-in person in your app a scoped MCP connection, so the app's AI only reads and writes that person's memory.
Copy page
How a person gets a connection
Your server calls provision_user with your app key (fsa_). Harny returns that person's key (fsk_) once. Store it on your server, keyed to your user record. Do not send it to the browser.
A person's key scopes these tools to that one person:
| Tool | What it does for that person |
|---|---|
ingest_text | Writes a note or durable fact into their memory |
assemble_context | Recalls ranked context from their memory and connected sources |
list_tools | Lists the tools their key may call, and whether each source is connected |
configure_oauth | Starts connecting one source for them |
action_history | Shows their recorded actions, newest first |
Calls are scoped to the key's user. Each call reaches only that person's memory.
Server-side only
- Keep person keys in your server's secret store or database. Never put one in a browser, a mobile bundle, or a URL.
- Make the MCP call from your server. Pass the person's key in the
Authorization: Bearerheader. - Use the MCP address
https://api.harny.ai/v1/mcp/mcp(Streamable HTTP).
Authorization: Bearer <the person's fsk_ key>Do not let the model pick the user
Your server chooses which person's key to use. The model never chooses a user id. Look up the key from your own session, then make the call. If the model's output names another person, ignore it.
Setup order
- Your server calls
provision_userwith the app key. It returns the person's key once. - Save the key on your server against the person's record.
- For each request from that person, load their key and call the tools above.
- To connect a source, call
configure_oauthand send the returned approval link to the person. Harny reads only their connected account after they approve.
The MCP server accepts bearer keys and sign-in tokens. Calls follow the same limits and refusals as the REST routes they wrap. A call over the per-minute limit answers 429 with Retry-After.
For how keys work, see Keys and access.