MCP setup
Use Ounie in Zed
Connect your Ounie brain to Zed AI assistant.
What you get#
Once connected, Zed can use these Ounie tools directly in your conversations:
ounie_list_brains— list your brains by name.ounie_get_context— retrieve the matching wiki pages so Zed writes the answer (faster, no extra model call).ounie_ask_brain— ask a grounded question; Ounie's own model writes the answer with citations.ounie_add_to_brain— save a chat result or text into a brain (synthesized into the wiki+graph).ounie_add_note— save a verbatim note as a new source.ounie_add_link— save a web link; Ounie fetches and ingests it.ounie_search— retrieve and summarize relevant saved sources.
See the full tool reference for all available tools and their arguments.
1. Connect with sign-in (no API key needed)#
Zed supports the MCP OAuth flow — it registers with Ounie automatically and redirects you to sign in. No API key is required for this option.
Hosted (HTTP — no API key needed, settings.json)
{
"context_servers": {
"ounie": {
"url": "https://ounie.com/api/mcp"
}
}
}Config file: ~/.config/zed/settings.json
2. Stdio fallback (API key required)#
If you prefer to run the server locally, or if the OAuth flow is unavailable, use the stdio transport with a personal API key.
Generate a key (ounie_live_…) at Settings → API keys. You'll see the full key exactly once — paste it into the OUNIE_API_KEY field below.
{
"context_servers": {
"ounie": {
"command": "npx",
"args": ["-y", "@ounie/mcp"],
"env": { "OUNIE_API_KEY": "ounie_live_…" }
}
}
}Notes#
- —Add the "context_servers" block to your Zed settings.json (Cmd+, to open it). Merge it with any existing keys.
- —For the HTTP entry, Zed detects the OAuth authorization server via RFC 9728 resource metadata and prompts you to sign in the first time a tool runs. No API key is needed.
- —You can also add a custom server through the Agent Panel: click the settings icon, then "Add Custom Server".
- —If no "Authorization" header is set on the HTTP entry, Zed will always prompt for OAuth before the first tool call — this is the correct behavior for the hosted endpoint.
Verify it works#
Open the Zed Agent Panel, start a new conversation, and ask "list my Ounie brains." Zed will prompt you to authenticate with Ounie on the first call; after that the tools run directly.
You can also check the REST API directly from your terminal:
curl -s https://ounie.com/api/brains \
-H "Authorization: Bearer ounie_live_…"Troubleshooting#
- 401 Unauthorized: For the OAuth flow, disconnect and reconnect to trigger a fresh sign-in. For the stdio/API-key option, the key may be wrong or revoked — generate a new one in Settings → API keys.
- Tools labeled read-only: tools such as
ounie_list_brains,ounie_get_context, andounie_searchcarry a read-only hint in the MCP tool descriptor. Some hosts display this as a lock icon or a "read-only" badge — this is expected and correct. Write tools (ounie_add_to_brain,ounie_add_note,ounie_add_link) do not carry that hint. - No tools appear: confirm the server URL is exactly
https://ounie.com/api/mcpwith no trailing slash, and that the config has been saved and the client reloaded. npxnot found: the stdio option requires Node.js 18 or later on your PATH. Install it from nodejs.org.- Self-hosting or local dev: set
OUNIE_BASE_URLin theenvblock to point at your local server (defaults tohttps://ounie.com).
Back to MCP overview · Manage connected apps in Settings → API keys.