Skip to content
kmem

Connect Claude Code

Claude Code connects to kmem with one terminal command. The command adds kmem for every project on your computer.

kmem has tested this route with Claude Code.

Create a connection

  1. In kmem, select Connect. The MCP tab opens.
  2. Select Claude Code in the list of clients.
  3. Fill in the New connection form. For example:
  4. Connection name: "Claude Code on Maya's laptop".
  5. Permission: Read and propose.
  6. Expires: 30 days.
  7. Select Create connection.

Create a connection explains each field.

kmem shows the command for Claude Code, with the endpoint and the token filled in. Copy the token now. kmem shows it only one time.

Run the command

  1. Under Command for Claude Code, select Copy command.
  2. Paste the command in a terminal, and run it.

The command looks like this:

claude mcp add --transport http --scope user kmem https://acme.kmem.app/mcp --header "Authorization: Bearer YOUR_TOKEN"

Replace acme with your org's subdomain and YOUR_TOKEN with the token of your connection. The Connect screen fills in both for you.

The command has these parts:

  • --transport http tells Claude Code that kmem is a remote MCP server.
  • --scope user adds kmem for your user account, so every project on this computer can use it. Without this option, Claude Code adds the server only for the folder where you ran the command.
  • kmem is the name of the server in Claude Code.
  • The --header option sends the token with each request.

If Claude Code says that a server named kmem already exists, remove the old server first. Read Remove kmem.

Check the connection

  1. Start a new Claude Code session.
  2. Run /mcp. Check that kmem is in the list and connected.
  3. Send the check prompt:
Use kmem to list the docs I can access. If there are none, say so.
  1. In kmem, select Check connection. The three checks must show Complete.

If kmem is not connected in /mcp, check the command. The endpoint must end with /mcp, and the token must be the token of an active connection.

Let an agent do the setup

You can ask an agent to add kmem for you. The Setup prompt holds the endpoint, the token and the steps for Claude Code.

  1. Under Setup prompt, select Copy setup prompt.
  2. Paste the prompt into Claude Code, or into another agent on the same computer.
  3. The agent runs the command. It then tells you to start Claude Code again.
  4. Start a new session, and send the check prompt.

The setup prompt contains your token. Give it only to the agent that the connection is for.

Remove kmem

To remove kmem from Claude Code, run this command:

claude mcp remove kmem --scope user

Then revoke the connection in kmem. Read Revoke a connection.

To change the token, remove kmem, then run the new command from Connect.

The kmem plugin for Claude Code

kmem also has a Claude Code plugin. The plugin adds the kmem server, a skill that tells Claude Code when to search and write kmem, and three hooks. The hooks are off until you turn them on.

The plugin is in the kmem source repository. It is not in a public plugin marketplace yet. You do not need the plugin to use kmem. The command on this page is enough.

Next steps