1export HALFSPAN_PRECEDENT_KEY='YOUR_PRECEDENT_KEY'
YOUR_HALFSPAN_API_HOST in the examples with your API host. Merge the examples into your existing client configuration, preserving other servers.~/.codex/config.toml. Codex reads the token from its environment.123[mcp_servers.halfspan-precedents] url = "https://YOUR_HALFSPAN_API_HOST/mcp/precedents" bearer_token_env_var = "HALFSPAN_PRECEDENT_KEY"
/mcp to check halfspan-precedents.1claude mcp add --transport http --scope user halfspan-precedents https://YOUR_HALFSPAN_API_HOST/mcp/precedents --header 'Authorization: Bearer ${HALFSPAN_PRECEDENT_KEY}'
/mcp to check halfspan-precedents.~/.cursor/mcp.json. Keep the environment variable reference as written.12345678910{ "mcpServers": { "halfspan-precedents": { "url": "https://YOUR_HALFSPAN_API_HOST/mcp/precedents", "headers": { "Authorization": "Bearer ${env:HALFSPAN_PRECEDENT_KEY}" } } } }
halfspan-precedents under Settings → Tools & MCP.opencode.jsonc. Keep the environment variable reference as written.1234567891011121314{ "mcp": { "servers": { "halfspan-precedents": { "type": "remote", "url": "https://YOUR_HALFSPAN_API_HOST/mcp/precedents", "oauth": false, "headers": { "Authorization": "Bearer {env:HALFSPAN_PRECEDENT_KEY}" } } } } }
/mcps to check halfspan-precedents.find_precedents is available. Ask your agent to call it with these arguments:1234{ "segment": "coding", "finding": "failed_tool" }
find_precedents for other findings and error responses.1234curl 'https://YOUR_HALFSPAN_API_HOST/mcp/precedents' \ -H "Authorization: Bearer $HALFSPAN_PRECEDENT_KEY" \ -H 'Content-Type: application/json' \ --data '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Authorization: Bearer <key>. The credential selects the workspace; there is no workspace argument in the tool. It permits this endpoint to search retained sessions across that workspace.hs_ API keys created in Settings → Credentials cannot authenticate it. There is no OAuth login flow for this endpoint.HALFSPAN_PRECEDENT_KEY_HASHES is a JSON object mapping the lowercase hexadecimal SHA-256 hash of each raw key to its workspace identifier string. Raw bearer tokens must contain 32–256 characters. An unconfigured or invalid credential map returns HTTP 503; an unknown key returns HTTP 401.Origin header return HTTP 403, so browser fetches cannot be used to connect. Responses carry Cache-Control: private, no-store.