MCP Setup Guide: Give Claude Code Structured Codebase Context
The Model Context Protocol (MCP) lets AI coding tools like Claude Code request structured data from external servers. Instead of reading your files one by one, Claude Code can ask Scope for exactly the context it needs — entities, endpoints, conventions, file paths — in a single call.
This guide walks you through setting up MCP with Claude Code and Scope.
Prerequisites
- A Scope account with a project
- A codebase — either a connected GitHub repo or a local codebase you'll sync via MCP
- Claude Code installed (
npm install -g @anthropic-ai/claude-code) - Node.js 18 or later
Step 1: Get your API key
In Scope, go to Settings → API Keys and generate a new key. It will look like scope_sk_.... Copy it — you'll need it in the next step.
Step 2: Install the MCP server
Scope provides a standalone MCP server package:
npm install -g scope-mcpStep 3: Configure Claude Code
Add Scope's MCP server to your Claude Code configuration. Create or edit~/.claude/claude_desktop_config.json:
{
"mcpServers": {
"scope": {
"command": "scope-mcp",
"env": {
"SCOPE_API_KEY": "scope_sk_your_key_here"
}
}
}
}Step 4: Verify the connection
Start Claude Code in your project directory. You should see Scope's tools available. Test it with:
Ask Claude Code: "Use the list tool to show my projects"If it returns your Scope projects, the connection is working.
Step 5: Sync your codebase
There are two ways to get your codebase into Scope:
- GitHub — Connect a repo from your project settings. Scope fetches and analyzes automatically.
- Local sync via MCP — Call
scope_syncto send your local file contents directly. Works with any codebase, no GitHub required.
Step 6: Start using structured context
Now instead of Claude Code reading your files to understand the codebase, it can:
# Get the next ticket with full context
start_ticket()
# Get specific entity details
get_context(scope: "entities:User+Order")
# Search for patterns
search(query: "authentication flow", type: "context")
# Complete a ticket — saves learnings back as context for future tickets
complete_ticket(summary: "Added user endpoint", files_modified: ["src/routes/users.ts"],
learnings: [{ type: "pattern", title: "Auth middleware", content: "Use withAuth() wrapper" }])
# Generate feature tickets from natural language
analyze({ type: "generate_feature", description: "Add Facebook OAuth login" })
# → Returns preview with proposed tickets, affected entities, file paths
# → Then apply: analyze({ type: "apply_feature", preview_id: "fp_xxx", approvals: { "0": true } })How it changes the workflow
Without MCP, a typical Claude Code session looks like:
- Read 15–30 files to understand the codebase (30,000+ tokens)
- Plan the implementation
- Write code
With Scope's MCP integration:
- Call
start_ticket()— get ticket, entities, conventions, file paths (1,500 tokens) - Write code immediately
- Call
complete_ticket()— log work, save learnings, get next action
The agent skips the entire file-reading phase because it already has structured context about your codebase. And each completed ticket feeds learnings back — patterns, gotchas, conventions — that improve context for the next ticket.
Generate features from natural language
Beyond executing tickets, Scope can create them. Describe a feature in plain English and Scope generates implementation-ready tickets grounded in your codebase:
analyze({ type: "generate_feature", description: "Add Stripe subscription billing" })
# → Preview: proposed tickets with file paths, affected entities, milestone placement
# → Review and approve, then apply to create the ticketsThis is the bridge between PM thinking ("we need billing") and developer execution (specific files, migrations, endpoints). The AI agent or PM can trigger it via MCP.
What context is available
Scope exposes 13 MCP tools covering:
- Workflow —
start_ticket,complete_ticket(saves learnings back as context) - Context —
get_context,search - Management —
update_ticket,review_milestone,list - Learning —
save_learning(patterns, gotchas, decisions, conventions) - Analysis —
analyze(includesgenerate_feature+apply_feature) - Setup —
scope_discover,scope_init,scope_sync,scope_sync_status
For the full tool reference, see the MCP Tools documentation.
Next steps
- Set up the autonomous workflow — let Claude Code work through tickets end-to-end
- Explore all 13 MCP tools — understand what context is available
- Read about the token economics — understand the 10–20x reduction