IDE MCP Integration
Learn how to integrate your developer IDE with TraceMem over MCP (Model Context Protocol) to automatically capture and store architecture decisions while working on complex developments.
Overview
TraceMem's Agent MCP server allows you to connect your IDE directly to TraceMem, enabling you to:
- Capture architecture decisions as you make them during development
- Store decision context with full traceability and audit trails
- Document design choices with structured metadata
- Maintain decision history across your development sessions
- Enable AI assistants in your IDE to make informed decisions based on past architecture choices
This integration is particularly valuable when working on complex systems where architectural decisions need to be tracked, reviewed, and referenced over time.
Prerequisites
Before setting up the integration, ensure you have:
- A TraceMem account - Sign up at app.tracemem.com
- An Agent API key - Generate one from your project settings
- MCP support - Your IDE must support MCP (Model Context Protocol)
Supported IDEs
This guide covers integration with the following IDEs:
- Claude Code (Anthropic) - See Claude Code Integration for MCP connector setup
- OpenAI Codex - See OpenAI Codex Integration for detailed setup
- Cursor
- Antigravity
- Visual Studio Code (with MCP extension)
Understanding MCP Configuration
TraceMem's Agent MCP server uses the following configuration:
- Endpoint:
https://mcp.tracemem.com - Protocol: JSON-RPC 2.0 over HTTP
- Authentication:
Authorization: Agent <your-api-key>header - Content-Type:
application/json
IDE-Specific Setup
Claude Code
Claude Code supports MCP servers through its configuration file. For teams building agent services using Anthropic's Messages API with the MCP connector, see the Claude Code Integration guide for direct remote MCP integration.
Basic Configuration
For local Claude Code installations, you can configure MCP servers through the configuration file:
Step 1: Locate Configuration File
The MCP configuration is typically located at:
- macOS/Linux:
~/.config/claude-code/mcp.jsonor~/.claude-code/mcp.json - Windows:
%APPDATA%\claude-code\mcp.json
Step 2: Add TraceMem MCP Server
Add the TraceMem MCP server configuration:
{
"mcpServers": {
"tracemem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-fetch"
],
"env": {
"MCP_SERVER_URL": "https://mcp.tracemem.com",
"MCP_AUTH_HEADER": "Agent YOUR_API_KEY_HERE"
}
}
}
}
Note: Replace YOUR_API_KEY_HERE with your actual TraceMem Agent API key.
Step 3: Restart Claude Code
Restart Claude Code to load the new MCP server configuration.
Step 4: Verify Connection
In Claude Code, you should now see TraceMem tools available. You can test the connection by asking Claude to list available TraceMem capabilities.
For MCP Connector Integration: If you're using Anthropic's Messages API with the MCP connector for direct remote MCP integration, see the Claude Code Integration guide for complete setup instructions including SKILL.md configuration.
Cursor
Cursor supports MCP servers through its settings.
Step 1: Open Cursor Settings
- Open Cursor
- Go to Settings (or press
Cmd+,on macOS /Ctrl+,on Windows/Linux) - Navigate to Features → MCP (or search for "MCP")
Step 2: Add MCP Server
Add a new MCP server configuration:
{
"mcpServers": {
"tracemem": {
"url": "https://mcp.tracemem.com",
"auth": {
"type": "header",
"header": "Authorization",
"value": "Agent YOUR_API_KEY_HERE"
}
}
}
}
Note: Replace YOUR_API_KEY_HERE with your actual TraceMem Agent API key.
Step 3: Restart Cursor
Restart Cursor to apply the configuration.
Step 4: Test Integration
You can test the integration by using Cursor's AI assistant to create a decision envelope. The TraceMem tools should be available in the AI context.
Antigravity
Antigravity supports MCP through its configuration system.
Step 1: Open Antigravity Settings
- Open Antigravity
- Navigate to Settings → MCP Servers
Step 2: Configure TraceMem Server
Add the following configuration:
mcp_servers:
tracemem:
endpoint: https://mcp.tracemem.com
auth:
type: bearer
token: YOUR_API_KEY_HERE
protocol: jsonrpc2
Note: Replace YOUR_API_KEY_HERE with your actual TraceMem Agent API key.
Step 3: Restart Antigravity
Restart Antigravity to load the new configuration.
Visual Studio Code
VS Code requires an MCP extension to connect to MCP servers.
Step 1: Install MCP Extension
- Open VS Code
- Go to Extensions (or press
Cmd+Shift+X/Ctrl+Shift+X) - Search for "MCP" or "Model Context Protocol"
- Install a compatible MCP extension (e.g., "MCP Client" or similar)
Step 2: Configure MCP Server
Add configuration to your VS Code settings (.vscode/settings.json or user settings):
{
"mcp.servers": {
"tracemem": {
"command": "node",
"args": [
"-e",
"require('@modelcontextprotocol/sdk').createClient({url: 'https://mcp.tracemem.com', auth: {type: 'header', header: 'Authorization', value: 'Agent YOUR_API_KEY_HERE'}})"
]
}
}
}
Alternative: If using an MCP extension with a different configuration format, follow the extension's documentation and use:
- URL:
https://mcp.tracemem.com - Auth Header:
Authorization: Agent YOUR_API_KEY_HERE
Step 3: Reload VS Code
Reload VS Code window (Cmd+R / Ctrl+R) or restart VS Code.
Using TraceMem in Your IDE
Once configured, you can use TraceMem tools directly from your IDE's AI assistant. Here are common use cases:
Capturing Architecture Decisions
When making an architectural decision, you can ask your IDE's AI assistant to:
Create a decision envelope for the architecture decision to use microservices
for the new payment system. Intent: "architecture.payment.microservices.design"
The AI will use the decision_create tool to create a decision envelope, which you can then use to track all related operations.
Documenting Design Choices
As you implement features, you can add context to your decisions:
Add context to decision TMEM_abc123: "Chose PostgreSQL over MongoDB for
transactional consistency requirements in the payment processing module."
Storing Decision Traces
After completing a feature or making a significant architectural change:
Close decision TMEM_abc123 with status "commit" and summary of the
microservices architecture implementation.
Example Workflow
Here's a typical workflow when working on a complex feature:
-
Start Development
- Ask your IDE AI: "Create a decision envelope for implementing the new authentication system"
- This creates a decision envelope with intent like
"architecture.auth.system.design"
-
Make Design Choices
- As you make decisions, add context: "Add context: Chose OAuth2 over SAML for better mobile support"
- The AI uses
decision_add_contextto record your reasoning
-
Track Implementation
- Document key implementation details: "Add context: Implemented JWT token refresh with 15-minute expiry"
-
Complete and Close
- When done: "Close the decision envelope with commit status"
- This finalizes the decision trace with all context and creates an immutable audit record
Security Best Practices
-
Protect Your API Key
- Never commit API keys to version control
- Use environment variables or IDE-specific secure storage when possible
- Rotate keys regularly
-
Use Environment Variables
- Store your API key in an environment variable:
bash
export TRACEMEM_API_KEY="your-api-key-here" - Reference it in your MCP configuration:
json
"value": "Agent ${TRACEMEM_API_KEY}"
- Store your API key in an environment variable:
-
Review Decision Access
- Ensure only authorized team members have access to your TraceMem project
- Review decision traces regularly for compliance
Troubleshooting
Connection Issues
If you're unable to connect to TraceMem:
- Verify API Key: Ensure your API key is correct and active
- Check Network: Verify you can reach
https://mcp.tracemem.com - Review Logs: Check your IDE's console/logs for error messages
- Test Endpoint: Try accessing the endpoint directly with curl:
bash
curl -H "Authorization: Agent YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}' \ https://mcp.tracemem.com
Tools Not Available
If TraceMem tools don't appear in your IDE:
- Restart IDE: Fully restart your IDE after configuration changes
- Check Configuration: Verify the MCP configuration syntax is correct
- Extension Issues: For VS Code, ensure the MCP extension is properly installed and enabled
- Permissions: Ensure your API key has the necessary permissions
Authentication Errors
If you receive authentication errors:
- Verify Header Format: Ensure the Authorization header is exactly
Agent <api-key>(with a space) - Check Key Validity: Verify your API key hasn't expired or been revoked
- Review Project Settings: Ensure the key belongs to the correct TraceMem project