Skip to content

Local MCP server

Run @myspec/mcp-server over stdio in Claude Desktop, Claude Code, Cursor and other local MCP clients.

Updated View as Markdown

The local MySpec MCP server is the @myspec/mcp-server npm package. Your MCP client starts it on your machine and talks to it over stdio. Besides the tools the remote server offers, it can save spec files to disk, upload attachments straight from a file path, and share a local folder with Brownfield sessions.

Requirements: Node.js 22 or later.

Install

Sign in

npx @myspec/mcp-server login

Your browser opens. Sign in to MySpec and approve the request. If you belong to more than one organization, the CLI asks which one to use.

Add the server to your client

claude mcp add myspec --scope user -- npx -y @myspec/mcp-server

Add this to claude_desktop_config.json, then restart Claude Desktop:

claude_desktop_config.jsonjson
{
  "mcpServers": {
    "myspec": {
      "command": "npx",
      "args": ["-y", "@myspec/mcp-server"]
    }
  }
}

Most clients read the same JSON shape, for example .cursor/mcp.json or a project .mcp.json:

.mcp.jsonjson
{
  "mcpServers": {
    "myspec": {
      "command": "npx",
      "args": ["-y", "@myspec/mcp-server"]
    }
  }
}

Check it works

Ask your agent to “list my MySpec projects”.

You can add the server before you sign in. Until you do, each tool call returns an error that tells you to run login; once you sign in, tools work without restarting the client.

Sign in

npx -y @myspec/mcp-server login               Sign in with your browser
npx -y @myspec/mcp-server login --paste       Sign in from another device
npx -y @myspec/mcp-server login --org <slug>  Sign in and choose the organization
npx -y @myspec/mcp-server auth status         Show who you are signed in as
npx -y @myspec/mcp-server logout              Sign out and remove saved credentials

When installed globally, the command is also available as myspec-mcp.

Choose the organization

Every MySpec sign-in works in one active organization. login picks it for you when you belong to one organization and asks when you belong to several. Pass --org to choose without a prompt, which you need in a non-interactive shell, or to switch organization later:

npx -y @myspec/mcp-server login --org my-team

Sign in from another device

When the browser is on a different machine than the CLI (a remote dev box, a container), use --paste:

npx -y @myspec/mcp-server login --paste

Open the printed link in any browser and sign in. If the page cannot reach the CLI, it shows a value like <code>.<state>. Copy the whole value, including the dot, and paste it into the terminal straight away: it expires a minute after you finish signing in.

Check your sign-in

npx -y @myspec/mcp-server auth status
Signed in to https://auth.myspec.dev
  Account:       jane@example.com
  Organization:  Acme Inc (acme)
  Credential:    login session (/home/jane/.myspec/oauth_creds.json)

It exits with 0 when you are signed in and 2 when you are not, so auth status || auth login works in scripts.

Use an API token instead

For anything that starts without a person present (a server, a container, CI), use an API token instead of login. Put it in the client’s env block:

.mcp.jsonjson
{
  "mcpServers": {
    "myspec": {
      "command": "npx",
      "args": ["-y", "@myspec/mcp-server"],
      "env": { "MYSPEC_API_TOKEN": "msp_pat_…" }
    }
  }
}

or register it in one command:

claude mcp add --scope user myspec \
  --env MYSPEC_API_TOKEN=msp_pat_… \
  -- npx -y @myspec/mcp-server

The token is never written to disk. See API tokens for the file-based option and how credentials take precedence.

Share a local folder for Brownfield projects

Brownfield sessions read your existing code. The reverse command lets MySpec’s AI read one folder on your machine, and nothing outside it:

npx -y @myspec/mcp-server reverse --root /path/to/your/project
  • Start it before you start the Brownfield session, and keep it running for the whole session.
  • Run it with the same MySpec account you use in the browser.
  • Only one bridge runs per account.

Environment variables

Variable Purpose
MYSPEC_API_TOKEN An API token (msp_pat_…) for unattended use. Never written to disk. Needs version 0.3.0 or later.
MYSPEC_USER_AUTH_URL The MySpec sign-in server. Defaults to https://auth.myspec.dev; you normally never set it.
MYSPEC_DOWNLOAD_ROOT Folder used to cache files read with read_spec_file. Defaults to ~/.myspec.

Files on your machine

The server keeps its state in ~/.myspec/:

  • settings.json: non-secret settings, such as which sign-in server you use.
  • oauth_creds.json: your sign-in, readable only by you (mode 0600).

logout deletes oauth_creds.json. download_spec_file saves files under a .specs/ folder in the working directory by default, so downloads don’t mix with your repository’s own files.

Edit spec files safely

Several people and AI sessions can work on a project at once. get_spec_file and read_spec_file return a content_version. Pass it to update_spec_file as expected_version: if someone else saved in the meantime, the update is rejected instead of overwriting their work. Read the file again, combine the changes, then update.

Troubleshooting

Problem What to do
Tools say you are not signed in Run npx -y @myspec/mcp-server login, or check auth status.
Pasted token is missing a state suffix Copy the whole <code>.<state> value, including the dot, not just the code.
OAuth code exchange failed: HTTP 401 after pasting The code expired. Run login --paste again and paste the value as soon as it appears.
MYSPEC_API_TOKEN seems ignored Update the package: the variable needs version 0.3.0 or later. npx -y always fetches the latest.
Brownfield session cannot see your code Make sure reverse is running with the same account as your browser, and that --root points at the project folder.
Navigation

Type to search…

↑↓ navigate↵ selectEsc close