MCP Server
MCP security
Keep your Harny keys out of chat, code and commits, and call the MCP server only from places you control.
Copy page
Keep keys out of chat, code and commits
Your app key starts with fsa_. A person's key starts with fsk_. Treat both as passwords. Put them in your secret store or in a .env file that your repo ignores. Do not paste them into a chat with an assistant, into source files, or into commit messages.
The provision_app answer carries the app key once. Save it right away in your secret store. The console creates app keys as well.
Use the no-account setup for coding agents
provision_app is the MCP tool that makes a new app. It needs no key. Its answer carries the app key once, and the assistant is told to put that key in your secret store and nowhere else.
If your coding agent can run commands, follow https://harny.ai/auth.md instead. One command makes the app and saves its key in .env where nobody reads it. The command never shows the key. It prints a claim link that you open later to take ownership of the app. The get_claim_link tool gives you a fresh one-time link. It is not an API key.
Use server-side keys only
Call the MCP server from a server. Do not call it from a browser, and do not ship a key in a web or mobile client.
How the MCP server checks access
- With no
Authorizationheader, the server offers onlyprovision_app. - With
Authorization: Bearer <key>, the server offers the tools that key may call. - The server accepts bearer keys and sign-in tokens. A sign-in token is issued only after the app's owner signs in on the Harny console. It lasts an hour, renews with a refresh token that rotates, and works only at the address it was issued for.
- Harny checks every request against the key.
- Calls are scoped to the key's user. A person's key reaches only that person's memory.
- Each app's data is separate, and each person's memory is separate.
Check what a key reaches
Call describe first. It returns what Harny is and what your key reaches, with the tools that key may call and their schemas. Call diagnose to see where your Harny connection stands.
get_setup_bundle lists key variable names, never key values.
Calls follow the REST refusals
An MCP call follows the same limits and refusals as the REST route it wraps. If you hit the per-minute limit, the server answers 429 with a Retry-After header. Wait for that time before you retry.