Synapse
Agent-aware app SDK for the MCP ext-apps protocol
Installation
npx synapseAsk AI about Synapse
Powered by Claude Β· Grounded in docs
I know everything about Synapse. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
No3sis - Knowledge Engine MCP Server
MCP server exposing the Synapse Pattern Map to Claude Code agents
No3sis (Ξ½ΟΞ·ΟΞΉΟ - "understanding, knowledge") is a FastMCP-based server that wraps the Synapse System's knowledge engine, enabling AI agents to access collective intelligence stored in Neo4j, Redis, and vector embeddings via the Model Context Protocol (MCP).
Architecture
Claude Code Agents
β (MCP stdio protocol)
No3sis MCP Server (FastMCP)
β (subprocess wrapper)
Synapse Knowledge Engine CLI Tools
ββ synapse_search.py β Neo4j + BGE-M3 vectors
ββ synapse_standard.py β Pattern Map standards
ββ synapse_template.py β Project templates
ββ synapse_health.py β Infrastructure monitoring
β
Infrastructure
ββ Neo4j (Pattern Map storage - 247+ patterns)
ββ Redis (Corpus Callosum cache)
ββ BGE-M3 (Semantic embeddings)
The 4 Knowledge Tools
1. search_pattern_map
Search the Synapse Pattern Map for relevant patterns, solutions, and best practices.
Claude Code Usage:
mcp__no3sis_search_pattern_map(
query="error handling patterns rust",
max_results=5
)
2. get_coding_standard
Retrieve language-specific coding standards from the Pattern Map.
Claude Code Usage:
mcp__no3sis_get_coding_standard(
standard_type="naming-conventions",
language="rust"
)
3. get_project_template
Access project templates and boilerplate code.
Claude Code Usage:
mcp__no3sis_get_project_template(
template_type="cli-app",
language="rust",
variables='{"project_name": "my-app"}' # Optional JSON string
)
4. check_system_health
Check health of Synapse knowledge engine infrastructure.
Claude Code Usage:
mcp__no3sis_check_system_health()
Installation
Prerequisites
- Python 3.12+
- Running Synapse knowledge engine (Neo4j + Redis)
- Synapse tools installed at
~/.synapse-system/.synapse/neo4j/ uvorpipfor installation
Setup
# Navigate to no3sis directory
cd /path/to/no3sis
# Install with uv (recommended)
uv venv
uv pip install -e .
# OR install with pip
pip install -e .
# Configure environment
cp .env.example .env
# Edit .env to set SYNAPSE_NEO4J_DIR
Environment Configuration
Create/edit .env file:
# Path to Synapse knowledge engine tools
SYNAPSE_NEO4J_DIR=/home/username/.synapse-system/.synapse/neo4j
# Optional: Default max results for searches
MAX_RESULTS_DEFAULT=10
# Optional: Enable debug logging
DEBUG=false
Registering with Claude Code
Method 1: Using claude mcp add (RECOMMENDED)
This is the correct way to register the MCP server with Claude Code CLI:
# Register in local scope (project-specific)
claude mcp add no3sis \
"/path/to/no3sis/.venv/bin/python" \
--scope local \
--transport stdio \
-e "SYNAPSE_NEO4J_DIR=/home/username/.synapse-system/.synapse/neo4j" \
-- -m no3sis.server
# Verify registration
claude mcp list
claude mcp get no3sis
Scope options:
local- Only available in current project (stored in~/.claude.jsonfor project)user- Available globally for all projectsproject- Uses.mcp.jsonin project root (requires approval)
Method 2: Project .mcp.json (Alternative)
Create .mcp.json in your project root:
{
"mcpServers": {
"no3sis": {
"command": "/path/to/no3sis/.venv/bin/python",
"args": ["-m", "no3sis.server"],
"env": {
"SYNAPSE_NEO4J_DIR": "/home/username/.synapse-system/.synapse/neo4j"
}
}
}
}
Note: Project-scoped .mcp.json files require explicit user approval for security.
Verification
# Check if server is connected
claude mcp list
# Should show: no3sis: β Connected
# Test in interactive session
claude
# Type: /mcp
# Should show no3sis with 4 tools available
Testing
CLI Testing Mode
The server supports direct CLI invocation for testing (bypasses MCP protocol):
cd /path/to/no3sis
# Test health check
.venv/bin/python -m no3sis.server health
# Test pattern search
.venv/bin/python -m no3sis.server search "error handling" 5
# Test coding standards
.venv/bin/python -m no3sis.server standard naming-conventions rust
# Test templates
.venv/bin/python -m no3sis.server template cli-app rust
MCP Protocol Testing
# Check MCP server health
claude mcp list
# Get detailed server info
claude mcp get no3sis
# Test in Claude session
claude
# Then use the tools via MCP protocol
Integration with Claude Code Agents
Agent Definition
Update .claude/agents/boss.md (or other agents):
---
tools: Read, Grep, Glob, Write, Bash, mcp__no3sis_search_pattern_map, mcp__no3sis_get_coding_standard, mcp__no3sis_get_project_template, mcp__no3sis_check_system_health
---
## Instructions
Use `mcp__no3sis_search_pattern_map` to query the Pattern Map for relevant patterns.
Use `mcp__no3sis_get_coding_standard` to retrieve language-specific standards.
Use `mcp__no3sis_get_project_template` to access project templates.
Use `mcp__no3sis_check_system_health` to check infrastructure status.
Tool Naming Convention
When Claude Code registers MCP tools, they're prefixed with mcp__<server_name>_:
search_pattern_mapβmcp__no3sis_search_pattern_mapget_coding_standardβmcp__no3sis_get_coding_standardget_project_templateβmcp__no3sis_get_project_templatecheck_system_healthβmcp__no3sis_check_system_health
Architecture Details
MCP Protocol Implementation
No3sis uses FastMCP with stdio transport:
- FastMCP handles MCP protocol (JSON-RPC over stdio)
- Tools are registered as async functions with
@mcp.tool()decorator - Communication happens via stdin/stdout pipes
- Claude Code spawns the server process and communicates bidirectionally
Subprocess Wrapper Strategy
The server shells out to existing Synapse CLI tools:
- Advantage: Zero changes to Synapse codebase
- Advantage: Easy to maintain and debug
- Overhead: ~20ms per request (acceptable for knowledge queries)
- Alternative: Future optimization could import Synapse modules directly
Request Flow
1. Agent invokes: mcp__no3sis_search_pattern_map("rust error handling", 5)
2. Claude Code β MCP JSON-RPC request via stdio β No3sis FastMCP
3. No3sis β subprocess.run(synapse_search.py) β Synapse tool
4. Synapse tool β Neo4j/Redis query β return JSON
5. No3sis β parse JSON β return to FastMCP
6. FastMCP β MCP response via stdio β Claude Code
7. Agent receives results
Why FastMCP?
- Simplicity: Decorator-based tool registration
- Protocol Compliance: Full MCP protocol support
- Async: Non-blocking I/O for multiple requests
- Stdio Transport: Standard for Claude Code integration
- Type Safety: Python type hints for tool parameters
Why Separate Repo?
- Independent versioning: No3sis can evolve separately from Synapse
- Reusability: Other projects can use the same knowledge engine
- Clean boundaries: MCP protocol is infrastructure, not agent logic
- Publishable: Can become
pip install no3sis-mcp-server
Directory Structure
no3sis/
βββ README.md # This file
βββ LICENSE # MIT
βββ pyproject.toml # Python package config (dependencies: mcp, python-dotenv)
βββ .env.example # Config template
βββ .gitignore
βββ src/no3sis/
β βββ __init__.py # Package exports
β βββ server.py # MCP server (~270 lines)
β βββ FastMCP setup
β βββ 4 tool implementations (@mcp.tool decorators)
β βββ CLI testing interface
β βββ stdio transport (run_stdio_async)
βββ tests/
βββ test_integration.py
Troubleshooting
Server Not Connecting
Error: no3sis: β Failed to connect
Solutions:
- Check venv path:
ls /path/to/no3sis/.venv/bin/python - Test CLI mode:
.venv/bin/python -m no3sis.server health - Check environment: Ensure
SYNAPSE_NEO4J_DIRis set correctly - Re-register:
claude mcp remove no3sis -s local && claude mcp add ...
Tool Not Found Errors
Error: Synapse tool not found: synapse_search.py
Solutions:
- Verify
SYNAPSE_NEO4J_DIRin.env - Check tools exist:
ls $SYNAPSE_NEO4J_DIR/synapse_*.py - Ensure Synapse is installed and configured
Connection Errors (Neo4j/Redis)
Error: Neo4j service not accessible
Solutions:
# Check services are running
docker ps | grep -E "neo4j|redis"
# Restart services
cd ~/.synapse-system/.synapse/neo4j
docker-compose up -d
Tools Not Available in Claude
Issue: /mcp shows "No MCP servers configured"
Solutions:
- Ensure you're in the correct project directory
- Check registration:
claude mcp list - Restart Claude Code session
- Verify
.claude.jsoncontains no3sis entry
Development
Running Tests
# Install dev dependencies
uv pip install -e ".[dev]"
# Run integration tests
pytest tests/ -v
Adding New Tools
- Add tool function in
server.py:
@mcp.tool()
async def my_new_tool(param: str) -> str:
"""Tool description for Claude."""
result = _run_synapse_tool("synapse_newtool.py", [param])
return json.dumps(result, indent=2)
- Create corresponding Synapse CLI tool
- Update agent definitions with
mcp__no3sis_my_new_tool
Performance
- Latency: ~20-50ms per request (subprocess overhead)
- Throughput: Async, handles multiple concurrent requests
- Caching: Synapse tools implement Redis caching (300s TTL)
- Future: Direct Python imports could reduce latency to ~5ms
Contributing
This repo is designed to be portable - it can live in the Synapse workspace or as a standalone repo at github.com/no3sis-lattice/synapse.
Pull requests welcome for:
- Performance optimizations (direct imports vs subprocess)
- Additional Synapse tools
- Improved error handling
- Documentation improvements
License
MIT
