A Model Context Protocol (MCP) server providing cognitive AI tools from the SIM-ONE framework, including emotional analysis, logical reasoning, validation, and cognitive governance.
- 13 Production-Ready Tools across 4 cognitive domains
- HTTP Transport with API key authentication
- STDIO Transport for local development
- SQLite Database for secure API key management
- All Tools Available via authenticated HTTP endpoints
esl_analyze_emotion- Multi-dimensional emotion detectionesl_analyze_emotional_progression- Track emotional changes over timeesl_generate_empathetic_response- Generate contextually appropriate responses
five_laws_validate_single_text- Validate AI responses against Five Lawsfive_laws_validate_batch- Batch validation with comparisonfive_laws_validate_iteratively- Iterative validation with refinement tracking
rep_perform_deductive_reasoning- Apply general rules to specific casesrep_perform_inductive_reasoning- Identify patterns from observationsrep_perform_abductive_reasoning- Infer best explanationsrep_perform_analogical_reasoning- Transfer knowledge across domainsrep_perform_causal_reasoning- Identify cause-and-effect relationshipsrep_perform_integrated_reasoning- Apply all reasoning types comprehensively
vvp_validate_rules- Validate logical rule structures
- Python 3.11+
- FastMCP 2.11.0+
- Clone the repository
git clone https://github.com/dansasser/SIM-ONE-MCP.git
cd SIM-ONE-MCP- Install dependencies
pip install fastmcp- Generate your first API key
python src/manage_keys.py generate --name "My First Client"Save the generated key securely - it won't be shown again!
Start the server with API key authentication:
python src/SIM-ONE_mcp.pyThe server will start on http://0.0.0.0:8000/mcp/
Make authenticated requests:
curl -H "Authorization: Bearer sk-simone-xxxxxxxxxxxxxxxxxxxxx" \
http://localhost:8000/mcp/For local development without authentication:
python src/SIM-ONE_mcp.py --stdiopython src/manage_keys.py generate --name "Production Client"With metadata:
python src/manage_keys.py generate --name "Test Client" --metadata '{"env":"test","team":"qa"}'python src/manage_keys.py listOutput:
================================================================================
ID Name Created Last Used Active
================================================================================
1 Production Client 2025-10-12 13:45:22 2025-10-12 14:30:15 ✓ Yes
2 Test Client 2025-10-12 13:50:10 Never ✓ Yes
================================================================================
Total: 2 key(s)
python src/manage_keys.py info --id 1python src/manage_keys.py revoke --id 2Configure the server using environment variables:
# Database location
export SIMONE_DB_PATH="data/api_keys.db"
# Server host and port
export SIMONE_HOST="0.0.0.0"
export SIMONE_PORT="8000"
# Run server
python src/SIM-ONE_mcp.pypython src/manage_keys.py --db /path/to/custom.db generate --name "Client"- Configure Nginx (
/etc/nginx/sites-available/simone-mcp):
server {
listen 443 ssl http2;
server_name mcp.yourdomain.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location /mcp/ {
proxy_pass http://127.0.0.1:8000/mcp/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}- Enable site:
sudo ln -s /etc/nginx/sites-available/simone-mcp /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx- Start server:
python src/SIM-ONE_mcp.pyYour server is now accessible at https://mcp.yourdomain.com/mcp/
Create /etc/systemd/system/simone-mcp.service:
[Unit]
Description=SIM-ONE MCP Server
After=network.target
[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu/SIM-ONE-MCP
Environment="SIMONE_HOST=127.0.0.1"
Environment="SIMONE_PORT=8000"
ExecStart=/usr/bin/python3 /home/ubuntu/SIM-ONE-MCP/src/SIM-ONE_mcp.py
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl enable simone-mcp
sudo systemctl start simone-mcp
sudo systemctl status simone-mcp- Cryptographically Secure Generation: Uses
secrets.token_urlsafe(32)for 256-bit entropy - Hashed Storage: Keys stored as SHA-256 hashes, never plaintext
- One-Time Display: Keys shown only once during generation
- Revocation Support: Keys can be deactivated without deletion
- Audit Trail:
last_used_attimestamps track key usage
- Never commit API keys to version control
- Use HTTPS in production (nginx/caddy with SSL)
- Rotate keys regularly (revoke old, generate new)
- Use unique keys per client for better audit trails
- Store keys securely (environment variables, secrets manager)
- Monitor key usage via
last_used_attimestamps
The SQLite database (data/api_keys.db) contains hashed keys and is excluded from git via .gitignore.
Backup recommendations:
# Backup database
cp data/api_keys.db data/api_keys.db.backup
# Restore from backup
cp data/api_keys.db.backup data/api_keys.dbSIM-ONE-MCP/
├── src/
│ ├── SIM-ONE_mcp.py # Main server with HTTP/STDIO transport
│ ├── auth/ # Authentication module
│ │ ├── __init__.py
│ │ ├── api_key_db.py # SQLite database manager
│ │ └── api_key_verifier.py # FastMCP auth integration
│ ├── manage_keys.py # CLI tool for key management
│ └── tools/ # Tool implementations
│ ├── esl_emotional_analysis_tutorial.py
│ ├── five_laws_validator_tutorial.py
│ ├── rep_reasoning_tutorial.py
│ └── vvp_validation_tutorial.py
├── data/ # Database directory (gitignored)
│ └── api_keys.db # SQLite database
├── tmp/ # Tool input/output files
│ ├── inputs/
│ └── outputs/
└── README.md
- Client sends request with
Authorization: Bearer sk-simone-...header - FastMCP extracts token and calls
APIKeyVerifier.verify_token() - Verifier hashes token and queries SQLite database
- If valid and active, updates
last_used_atand returns user info - FastMCP allows request to proceed to tools
- If invalid, FastMCP returns 401 Unauthorized
| Mode | Command | Authentication | Use Case |
|---|---|---|---|
| HTTP | python src/SIM-ONE_mcp.py |
API Key Required | Production, remote access |
| STDIO | python src/SIM-ONE_mcp.py --stdio |
None (local security) | Local development, testing |
Error: ModuleNotFoundError: No module named 'fastmcp'
Solution:
pip install fastmcpError: 401 Unauthorized
Check:
- API key is valid:
python src/manage_keys.py list - Key is active (not revoked)
- Header format:
Authorization: Bearer sk-simone-... - No extra spaces or newlines in key
Error: sqlite3.OperationalError: database is locked
Solution:
# Close any open connections
pkill -f manage_keys.py
# If persists, restart server
pkill -f SIM-ONE_mcp.py
python src/SIM-ONE_mcp.pyError: OSError: [Errno 98] Address already in use
Solution:
# Find process using port 8000
lsof -i :8000
# Kill process
kill -9 <PID>
# Or use different port
export SIMONE_PORT=8001
python src/SIM-ONE_mcp.py# Test key generation
python src/manage_keys.py generate --name "Test"
# Test server startup
python src/SIM-ONE_mcp.py &
SERVER_PID=$!
# Test authentication (replace with your key)
curl -H "Authorization: Bearer sk-simone-..." http://localhost:8000/mcp/
# Cleanup
kill $SERVER_PIDTools are automatically mounted from the tools/ directory. To add new tools:
- Create tool file in
src/tools/ - Import in
src/SIM-ONE_mcp.py - Mount using
mcp.mount(new_tool_mcp)
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is part of the SIM-ONE framework. See the main SIM-ONE repository for license information.
- SIM-ONE Framework - Core cognitive framework
- FastMCP - MCP server framework
For issues, questions, or contributions:
- Open an issue on GitHub
- See the SIM-ONE documentation
- Added HTTP transport support
- Implemented SQLite-based API key authentication
- Created key management CLI
- Maintained backward compatibility with STDIO mode
- Added comprehensive documentation
- 13 cognitive tools from SIM-ONE framework
- STDIO transport
- Basic tool implementations