Start free
Terminal and CLI agents

KnowMan MCP server for OpenCode

Updated 2 min read

Setup in brief

Add KnowMan to OpenCode as a local MCP server with opencode mcp add knowman --env KNOWMAN_API_KEY=km_... -- npx -y @knowman/mcp. OpenCode starts local servers over MCP stdio, according to its MCP server documentation. KnowMan's package and MCP server details are documented in the KnowMan MCP guide.

opencode.jsonc JSON
{
  "mcp": {
    "servers": {
      "knowman": {
        "type": "local",
        "command": ["npx", "-y", "@knowman/mcp"]
      }
    }
  }
}
On this page8 sections
  1. Add KnowMan from the terminal
  2. Use the OpenCode config file
  3. Sign in once with knowman login
  4. Verify the OpenCode connection
  5. Search your KnowMan library
  6. Read and save library items
  7. Review recent items and memories
  8. Questions people ask

Add KnowMan from the terminal

Run opencode mcp add knowman --env KNOWMAN_API_KEY=km_... -- npx -y @knowman/mcp. OpenCode places the command after --, passes the environment variable, and writes the server to the project configuration. Add --global if you want it available in every project. See OpenCode MCP server documentation.

Use the OpenCode config file

You can also add the server by hand under mcp.servers in opencode.jsonc. OpenCode V2 does not place server names directly under mcp. A local server uses "type": "local" and a command array containing the executable followed by its arguments. See OpenCode MCP server documentation.

Sign in once with knowman login

Run npx -p @knowman/mcp knowman login once. The browser sign-in saves a credential shared by the KnowMan CLI and MCP server. After that, you can remove the KNOWMAN_API_KEY entry from the OpenCode configuration. See the KnowMan MCP guide.

Verify the OpenCode connection

Run opencode mcp list from any project. Look for ✓ knowman connected. OpenCode connects servers automatically. If the entry says needs authentication, open OpenCode, run /mcps, select the server, and sign in. See OpenCode MCP server documentation.

Search your KnowMan library

kb_search searches saved items by keyword or meaning and returns titles, URLs, and metadata. kb_ask answers questions with citations. These tools let OpenCode work with saved articles and links in your KnowMan library. See the KnowMan MCP guide.

Read and save library items

kb_get_item returns the readable content and metadata for one item. kb_save saves a URL to the Inbox or Knowledge Base, with an optional note. Together, they let OpenCode retrieve full items and add new links. See the KnowMan MCP guide.

Review recent items and memories

kb_recent lists recently saved Inbox or Knowledge Base items. kb_memories lists saved claims, decisions, and playbooks. These tools give OpenCode access to recent library activity and stored working knowledge. See the KnowMan MCP guide.

Questions people ask

Does OpenCode support the KnowMan MCP server?

Yes. OpenCode starts local servers over the MCP stdio transport. The KnowMan package is a local stdio MCP server. See OpenCode MCP server documentation and the KnowMan MCP guide.

Do I need an API key in the OpenCode config?

You can use KNOWMAN_API_KEY=km_... with the OpenCode add command. After running npx -p @knowman/mcp knowman login, the saved credential can be used without that environment variable. See the KnowMan MCP guide.

How do I check whether KnowMan is connected?

Run opencode mcp list and look for ✓ knowman connected. Use /mcps inside OpenCode to view, connect, disconnect, or authenticate servers. See OpenCode MCP server documentation.

Which tools does KnowMan expose to OpenCode?

KnowMan exposes six tools: kb_search, kb_ask, kb_get_item, kb_save, kb_recent, and kb_memories. They cover search, cited answers, item reading, URL saving, recent items, and saved memories. See the KnowMan MCP guide.

Give OpenCode access to your library

Try KnowMan Pro for 14 days with no credit card. Create your account

Start free

Every new account starts with 14 days of Pro. No credit card.