| description | Connect Empathy Framework to Claude Code via MCP. Enable AI workflows, agent coordination, and pattern learning in your IDE. |
|---|
Connect Empathy Framework workflows directly to Claude Code or Claude Desktop using the Model Context Protocol.
New in v5.1.1: Empathy MCP server exposes all production workflows as native tools - security audits, test generation, performance analysis, and more.
The Model Context Protocol (MCP) is an open standard for connecting AI applications to external tools and data sources. Empathy Framework exposes its workflows, authentication system, and telemetry as MCP tools.
Best for: Development workflows in VSCode
Empathy Framework includes .claude/mcp.json configuration. Claude Code automatically discovers the MCP server when you open the project.
- Install Empathy Framework:
pip install empathy-framework[developer]- Open project in Claude Code
The MCP server is automatically configured via .claude/mcp.json:
{
"mcpServers": {
"empathy": {
"command": "python",
"args": ["-m", "empathy_os.mcp.server"],
"env": {
"ANTHROPIC_API_KEY": "${ANTHROPIC_API_KEY}",
"PYTHONPATH": "${workspaceFolder}/src"
}
}
}
}-
Restart Claude Code to load the server
-
Use natural language:
"Run a security audit on src/"
"Generate tests for config.py"
"Check my authentication configuration"
"Analyze performance bottlenecks"
Best for: General-purpose AI workflows
Add to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"empathy": {
"command": "python",
"args": ["-m", "empathy_os.mcp.server"],
"env": {
"ANTHROPIC_API_KEY": "your-api-key-here",
"PYTHONPATH": "/path/to/empathy-framework/src"
}
}
}
}Then restart Claude Desktop.
The Empathy MCP server exposes all production workflows as tools:
| Tool | Description | Required Args |
|---|---|---|
security_audit |
Scan code for vulnerabilities, dangerous patterns, security issues | path |
bug_predict |
Analyze code patterns and predict potential bugs | path |
code_review |
Comprehensive code quality analysis with suggestions | path |
test_generation |
Generate tests for code (supports batch mode) | module, batch (optional) |
performance_audit |
Identify bottlenecks, memory leaks, optimization opportunities | path |
release_prep |
Run release checks: health, security, changelog | path (optional) |
| Tool | Description | Required Args |
|---|---|---|
auth_status |
Get authentication strategy status and configuration | none |
auth_recommend |
Get authentication recommendation for a file | file_path |
telemetry_stats |
Get cost savings, cache hit rates, workflow performance | days (optional) |
dashboard_status |
Get agent coordination dashboard status | none |
| Resource URI | Description |
|---|---|
empathy://workflows |
List of all available workflows |
empathy://auth/config |
Current authentication strategy configuration |
empathy://telemetry |
Cost tracking and performance metrics |
Natural language commands are automatically routed to the appropriate tool:
Security Analysis:
User: "Run a security audit on the authentication module"
Claude: [Invokes security_audit tool with path="src/auth/"]
Test Generation:
User: "Generate tests for the config module"
Claude: [Invokes test_generation tool with module="src/empathy_os/config.py"]
Cost Optimization:
User: "What's my current authentication setup?"
Claude: [Invokes auth_status tool]
Response: {
"success": true,
"subscription_tier": "max",
"default_mode": "api",
"setup_completed": true
}
Direct tool invocation or natural language:
You: Check for security vulnerabilities in my API code
Claude: I'll run a security audit using the empathy security_audit tool.
[Invokes security_audit(path="src/api/")]
Found 3 medium-severity issues:
- SQL injection risk in query builder (line 42)
- Missing input validation on user endpoint (line 78)
- Weak password hashing algorithm (line 156)
# Test tool listing
echo '{"method":"tools/list","params":{}}' | PYTHONPATH=./src python -m empathy_os.mcp.server
# Test tool execution
echo '{"method":"tools/call","params":{"name":"auth_status","arguments":{}}}' | PYTHONPATH=./src python -m empathy_os.mcp.server# Check server starts without errors
python -m empathy_os.mcp.server --help
# View comprehensive test results
cat .claude/MCP_TEST_RESULTS.mdEmpathy automatically validates outputs via Claude Code hooks:
Python File Validation:
- Syntax checking after file writes
- Imports and dependencies verified
JSON File Validation:
- Format checking after file writes
- Schema validation where applicable
Workflow Output Verification:
- AI-powered validation of workflow results
- Ensures required fields are present
- Catches common errors
Configuration in .claude/settings.local.json (automatically set up).
Check Python environment:
python -c "import empathy_os.mcp.server; print('OK')"Check PYTHONPATH:
# Should include src directory
echo $PYTHONPATH- Verify
.claude/mcp.jsonexists in project root - Restart Claude Code completely
- Check Claude Code status bar for "empathy" server
- Review logs in Claude Code output panel
- Verify config path is correct for your OS
- Check JSON syntax - use a validator
- Set PYTHONPATH to absolute path of empathy-framework/src
- Restart Claude Desktop fully (quit and reopen)
Check API key:
echo $ANTHROPIC_API_KEYCheck workflow dependencies:
pip install empathy-framework[developer]Review error logs:
- Claude Code: Output panel → "Claude Code" channel
- Claude Desktop: Application logs
- Direct test: Stderr output from python command
| Use Case | Best Interface |
|---|---|
| Development in VSCode | MCP (Claude Code) - Natural language, automatic discovery |
| Interactive exploration | MCP (Claude Desktop) - Conversational, guided workflows |
| CI/CD pipelines | CLI - empathy workflow run security-audit |
| Custom integrations | Python API - Full programmatic control |
The MCP server works with any MCP-compatible client:
- Claude Code (VSCode extension) - Automatic project discovery
- Claude Desktop - General-purpose AI assistant
- Cursor IDE - Similar configuration to Claude Desktop
- Custom clients - Use the MCP SDK to connect
- CLI testing - Pipe JSON-RPC messages directly
- MCP Test Results - Full integration test report
- CLI Reference - Command-line interface
- Python API - Programmatic access
- Workflows Guide - Workflow documentation
Note: The Socratic workflow builder MCP server (empathy_os.socratic.mcp_server) is deprecated in v5.1.1+. Use the production Empathy MCP server (empathy_os.mcp.server) instead, which exposes all workflows directly.