Overview
AI coding agents are only as good as the context they have. Without architectural understanding, they guess — reinventing existing services, violating naming conventions, breaking invariants they didn’t know existed. The result is code that works in isolation but doesn’t fit the system. CoreStory eliminates this problem by giving your AI agent access to code intelligence — synthesized knowledge about how your system actually works, drawn from PRDs, technical specifications, user stories, code history, and architecture analysis. The agent queries this intelligence through MCP (Model Context Protocol) to understand the system before writing code, not after. This guide shows you how to connect CoreStory to your AI coding agent, verify the connection, and start using code intelligence in your development workflows. For specific workflow playbooks (bug resolution, feature implementation, spec-driven development), see the links in the Use Cases section.What CoreStory Gives Your Agent
CoreStory serves two roles in every workflow:- Oracle — answers questions about intended system behavior, invariants, business rules, architectural patterns, and design history. This is context synthesized from your entire codebase — not just file contents, but the meaning behind them.
- Navigator — points to specific files, methods, extension points, and code paths relevant to a task. Instead of grep-wandering through a codebase, the agent gets directed guidance.
Prerequisites
- A CoreStory account with at least one project that has completed ingestion
- An AI coding agent that supports MCP (see Supported Agents below)
- A code repository the agent can read and write to
Quick Start
Step 1: Get Your MCP Token
- Go to Settings in the CoreStory Dashboard
- Scroll to IDE Integrations and click Configure under “MCP Connection”
- Enter a token name (e.g., “MacBook Pro”, “Work Desktop”) and click Generate MCP Token
- Copy the token immediately — it won’t be shown again
Step 2: Configure Your Agent
Add the CoreStory MCP server to your agent’s configuration. The connection uses a single HTTPS endpoint:Step 3: Verify the Connection
Ask your agent:Step 4: Verify Project Readiness
Before starting any task, confirm your project has completed ingestion:list_projects and return project details including status. Confirm the project you want to work with is ready before proceeding.
CoreStory MCP Tools
Once connected, these tools are available to your AI assistant:| Tool | Description |
|---|---|
list_projects | List all projects in your organization |
get_project_prd | Retrieve Product Requirements Document |
get_project_techspec | Retrieve Technical Specification |
list_conversations | List project conversations |
get_conversation | Get conversation details and history |
create_conversation | Create new conversation |
rename_conversation | Rename existing conversation |
send_message | Send message to conversation (streaming response) |
The Core Interaction Pattern
Most CoreStory workflows follow this pattern:- Select project —
list_projects→ confirm the right project - Create conversation —
create_conversationwith a descriptive title - Query the Oracle —
send_messageto understand system behavior, invariants, and architecture - Query the Navigator —
send_messageto find specific files, methods, and extension points - Act on the knowledge — implement, test, or document based on what CoreStory revealed
- Close the loop —
rename_conversationto mark the thread as resolved
Use Cases
CoreStory’s code intelligence powers a range of development workflows. Each has a dedicated playbook with step-by-step implementation guidance:| Use Case | Description | Playbook |
|---|---|---|
| Bug Resolution | Diagnose and fix bugs with full architectural context. The agent queries CoreStory to understand how the system should work, generates root cause hypotheses, writes a failing test, and implements a minimal fix. | Agentic Bug Resolution |
| Feature Implementation | Implement features from tickets using CoreStory to understand existing patterns, data structures, and integration points. TDD workflow with continuous architectural validation. | Feature Implementation |
| Spec-Driven Development | Write architecture-grounded specifications before implementation. CoreStory provides the architectural truth that standalone SDD tools can’t — ensuring specs describe delta changes constrained by what actually exists. | Spec-Driven Development |
| Test Generation | Derive comprehensive test suites from CoreStory specifications — positive cases, negative cases, edge cases, error contracts, and idempotency tests. | Automated Test Generation |
| M&A Technical Due Diligence | Analyze acquisition targets using CoreStory to understand architecture, identify risks, assess technical debt, and evaluate integration complexity. | M&A Due Diligence |
Additional Use Cases
These workflows don’t have dedicated playbooks but follow the same Oracle → Navigator pattern:- Spec/Code Gap Analysis — identify discrepancies between CoreStory specifications and actual implementation, then remediate
- Architecture Comprehension — understand component boundaries, data flows, and integration points for refactoring or onboarding
- API Contract Validation — extract API contracts from specs, validate against code, and generate contract tests
- Security Baseline Review — audit error handling, validation, and idempotency against spec security sections
- Developer Onboarding Documentation — generate onboarding guides by cross-referencing CoreStory specs with source code
- Release Notes Generation — analyze feature changes and generate release notes keyed to business rules and endpoints
Supported Agents & Configuration
CoreStory works with any MCP-capable AI coding agent. Below are configuration instructions for the most common agents.Claude Code
Claude Code connects to MCP servers via CLI or configuration file. Option A: CLI (recommended)user (available in all projects), local (current project only), or project (shared via .mcp.json).
Option B: Configuration file
Add to ~/.claude.json (user scope) or .mcp.json (project scope):
claude mcp list to confirm the server appears, then ask “List my CoreStory projects.”
Agent-specific configuration files: Claude Code uses skills stored in .claude/skills/. Each workflow playbook includes a ready-to-use skill file that encodes the full workflow for that use case.
GitHub Copilot (VS Code)
VS Code supports MCP servers through the.vscode/mcp.json file or user settings.
Option A: Workspace configuration (shared with team)
Create .vscode/mcp.json in your project root:
Cmd/Ctrl + , → “Open Settings (JSON)”) and add:
.github/copilot-instructions.md) and prompt files (.github/prompts/). Each workflow playbook includes ready-to-use instruction and prompt files.
Cursor
Cursor supports MCP servers through.cursor/mcp.json (project) or ~/.cursor/mcp.json (global).
Option A: Project configuration
Create .cursor/mcp.json:
- Open Settings (
Cmd/Ctrl + Shift + P→ search “MCP”) - Click Tools & Integrations → New MCP Server under MCP Tools
- Add the configuration above
.cursor/rules/. Each workflow playbook includes a ready-to-use rule file.
Factory.ai
Factory.ai connects to MCP servers through droid configuration. Configuration: Add CoreStory to your droid’s MCP servers in the Factory.ai dashboard or.factory/config.json:
.factory/droids/. Each workflow playbook includes a ready-to-use droid file.
Devin
Devin supports MCP servers through its MCP Marketplace. Configuration:- Open the Devin MCP Marketplace
- Search for CoreStory or add a custom MCP server
- Enter the URL:
https://c2s.corestory.ai/mcp - Add the Authorization header with your token
Windsurf
Windsurf supports MCP servers through its configuration file. Configuration: Add to your Windsurf MCP configuration (typically~/.windsurf/mcp.json or through the settings UI):
Other MCP-Capable Agents
Any agent that supports MCP’s HTTP transport can connect to CoreStory. The configuration pattern is the same:- Transport: HTTP (streamable)
- URL:
https://c2s.corestory.ai/mcp - Authentication: Bearer token in the
Authorizationheader
Best Practices
Effective CoreStory Queries
The quality of CoreStory’s responses depends on the specificity of your queries. Be specific, not broad:| Instead of | Try |
|---|---|
| ”Tell me about the order system" | "What is the validation logic for order placement? What fields are required, what are the business rules for minimum amounts, and how is stock validation handled?" |
| "How does authentication work?" | "What is the session timeout configuration? How are JWT tokens validated, and what happens when a token expires during an active request?" |
| "Tell me about the API" | "What are the error response formats for the payment endpoints? Do they follow RFC-7807? What HTTP status codes map to which error conditions?” |
Oracle Before Navigator
Always query for understanding before querying for location. The Oracle phase (how does this work? what are the invariants?) should come before the Navigator phase (which files do I need to change?). This prevents the agent from diving into code changes before understanding the system’s constraints.Conversation Hygiene
- One conversation per task. Create a conversation with a descriptive title like “Bug Fix: #1234 — Payment retry failing on 503 errors” or “Feature: #412 — Webhook notification system.”
- Reuse conversations for follow-up queries on the same task. The conversation accumulates context that improves subsequent responses.
- Rename when done. Mark completed conversations with a prefix like ”✅ Resolved:” so future users can find institutional knowledge.
Cost Control
- Retrieve before regenerating. Use
get_project_prdandget_project_techspecto check if documents already exist before asking the agent to generate new content. - Reuse conversations instead of creating new ones for related queries — conversation context reduces the need for repeated background queries.
- Batch queries. Plan your questions in advance and ask comprehensive questions instead of many small ones.
Security
- Never commit tokens to version control. Use environment variables, input prompts (VS Code), or secure credential storage.
- Use project-scoped tokens when sharing configuration with a team, and let each team member enter their own token.
- Rotate tokens regularly and revoke compromised tokens immediately in CoreStory Settings.
- Review generated content for sensitive data before committing to public repositories.
Troubleshooting
Agent Can’t See CoreStory Tools
Symptoms: Agent doesn’t list CoreStory tools, can’t access CoreStory resources, or errors about missing MCP server. Solutions:- Verify the MCP server appears in your agent’s server list (e.g.,
claude mcp listfor Claude Code, or the tools panel in VS Code/Cursor) - Check that the token is correct and hasn’t expired — try generating a new one
- Verify the URL is exactly
https://c2s.corestory.ai/mcp(no trailing slash) - Restart your agent after configuration changes
- Ask the agent to list available MCP servers and tools as a diagnostic
Project Not Found or Ingestion Incomplete
Symptoms:list_projects returns empty, or queries return incomplete/stale data.
Solutions:
- Verify you have access to the project in the CoreStory dashboard
- Check ingestion status — projects must show “completed” or “ready” before querying
- If ingestion appears stuck, contact CoreStory support
- Don’t proceed with heavy queries until ingestion is complete
Slow or Rate-Limited Responses
Symptoms: Slow responses, timeouts, or rate-limiting errors. Solutions:- Reduce query frequency — batch related questions into single, comprehensive queries
- Reuse conversations instead of creating new ones
- Retrieve existing documents instead of regenerating
- Use incremental section generation instead of full document generation
Agent Times Out on Long Tasks
Symptoms: Agent sessions end before completing multi-step workflows. Solutions:- Break large tasks into milestones — have the agent commit after each phase
- Use the conversation ID to resume context in a new session
- For agents with session limits (e.g., Devin ACU limits), prioritize the Oracle and Navigator phases first, then implement in a separate session
What’s Next
Once you’ve verified your CoreStory connection, pick a workflow and follow its playbook:- First time? Start with Bug Resolution — it’s the most concrete workflow and demonstrates the Oracle → Navigator → Implement pattern clearly.
- Building something new? Use Spec-Driven Development to ground your specification in the real architecture before implementation.
- Working from tickets? Feature Implementation covers the full ticket-to-merge workflow with TDD and continuous architectural validation.