Spardocs

Connect an LLM agent

Give an LLM agent scoped access to a Spar site through the Model Context Protocol.

Spar exposes a site-scoped Model Context Protocol endpoint at:

https://spar.so/api/mcp

The endpoint uses Streamable HTTP. Your client must send the credential as a Bearer token in each request; OAuth-only clients are not supported.

Create a credential in Settings → MCP for the site you want to connect. Choose Allow draft test creation only when the agent should be able to create draft tests. Live test changes are not available through MCP.

The full token is shown once. Store it as SPAR_MCP_TOKEN in the environment where your agent runs:

export SPAR_MCP_TOKEN="paste-the-token-here"

For Codex, register the endpoint with the environment variable:

codex mcp add spar \
  --url https://spar.so/api/mcp \
  --bearer-token-env-var SPAR_MCP_TOKEN

Access follows the issuing user's current site membership, permissions, and plan, so removing site access or changing permissions takes effect on the next request. A credential with the drafts:write scope can create draft tests when the issuing user has test creation permission. Full audit evidence and detailed test results have their own permission and plan gates.

Credentials expire after 90 days. Revoke one from Settings → MCP if the agent should lose access sooner, then create a new credential when needed.

Last updated on