Gravitas-Core-MCP
Production-grade, autonomous Model Context Protocol (MCP) server that elevates AI models from stateless code generators into persistent, self-verifying software engineers.
README
Gravitas-Core-MCP
Version: 0.1.0
Role: Core System Blueprint / Autonomous AI Control Plane
Target Platforms: VS Code (Cline / Claude Dev), Cursor, Windsurf, Claude Desktop
Production-grade, autonomous Model Context Protocol (MCP) server that elevates AI models from stateless code generators into persistent, self-verifying software engineers.
Features
- Persistent memory — SQLite-backed task ledger, context snapshots, canonical state, failure memory, tool usage patterns
- Cognitive control — Deterministic task state machine (PLANNING → CODING → EXECUTING → VERIFYING → COMPLETED / FAILED_RETRY / ROLLBACK), retry policies, rollback on repeated failures
- Terminal engine — Shell execution with timeout, cwd isolation, allowlist/denylist, background process management
- Browser engine — Playwright-based navigation, DOM snapshot, screenshots, console error streaming
- Project intelligence — Recursive structure analysis with noise filtering (
.git,node_modules, build artifacts) - Model handover — Auto-generated Model Resume Package (goal, task, constraints, failures, safe/do-not-touch files) for model swap, editor restart, or crash recovery
Requirements
- Python 3.10+
- UV (Astral) for install/run
- Browser: Uses existing Chrome or Edge on your machine when available — no
playwright installrequired. If you have neither, runplaywright install chromiumonce.
Installation
No local install needed — run directly from GitHub (see Use it from GitHub below):
uvx run git+https://github.com/ahmed-coding/Gravitas-Core.git
Or install from PyPI:
# Install and run via uvx (no global install)
uvx Gravitas-Core-MCP
Or install into a project:
uv add Gravitas-Core-MCP
# Then run: uv run Gravitas-Core-MCP
Browser tools: If you already have Chrome or Edge installed, nothing else is needed. Otherwise, run once: uv run playwright install chromium.
Use it from GitHub (direct configuration)
Run the server directly from this repository with no local installation — UV fetches the repo and runs it. Repository: ahmed-coding/Gravitas-Core.
The repo includes a GitHub Action (.github/workflows/ci.yml) that runs tests and verifies the server starts; you can see it in the Actions tab after push.
Run from GitHub with uvx
uvx run git+https://github.com/ahmed-coding/Gravitas-Core.git
Or pin a branch/tag:
uvx run "git+https://github.com/ahmed-coding/Gravitas-Core.git@main"
uvx run "git+https://github.com/ahmed-coding/Gravitas-Core.git@v1.1.0"
MCP client config (GitHub direct)
Requires UV to be installed and uvx in your PATH. If you see spawn uvx ENOENT, use the localhost config below instead (no uv/uvx needed).
Cursor — e.g. ~/.cursor/mcp.json or .cursor/mcp.json:
{
"mcpServers": {
"gravitas-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/ahmed-coding/Gravitas-Core.git",
"Gravitas-Core-MCP"
]
}
}
}
With a specific ref (branch or tag):
{
"mcpServers": {
"gravitas-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/ahmed-coding/Gravitas-Core.git@main",
"Gravitas-Core-MCP"
]
}
}
}
Cloned repo (run from local path):
{
"mcpServers": {
"gravitas-mcp": {
"command": "/path/to/Gravitas-Core/.venv/bin/python",
"args": ["-m", "gravitas_mcp.server"]
}
}
}
(Create the venv first: cd /path/to/Gravitas-Core && uv venv && uv sync, then use .venv/bin/python in command.)
Run from localhost (local clone)
Use the server from a clone on your machine so you can develop and test without GitHub.
1. Clone and install (one time)
git clone https://github.com/ahmed-coding/Gravitas-Core.git
cd Gravitas-Core
uv sync
(If you don’t have UV: pip install uv or use python -m venv .venv && .venv/bin/pip install -e . and then use .venv/bin/python in the configs below.)
2. Run the server in a terminal (optional)
cd /path/to/Gravitas-Core
uv run python -m gravitas_mcp.server
OR with uvicorn
cd /path/to/Gravitas-Core
uv run python -m gravitas_mcp.mcp_webapp
The server uses stdio; your MCP client (Cursor, etc.) will start it automatically when configured.
3. MCP config for localhost
Option A — Use this repo as the Cursor project (recommended)
Open the Gravitas-Core folder in Cursor. The project already includes .cursor/mcp.json so the gravitas MCP server runs from your local clone (no GitHub needed).
Option B — Use from any project (user-level config)
Copy this into ~/.cursor/mcp.json and replace YOUR_PATH with the full path to your clone (e.g. /home/ahmed/Desktop/Gravitas-MCP-Core or C:\Users\You\Gravitas-Core):
{
"mcpServers": {
"gravitas-mcp": {
"command": "YOUR_PATH/.venv/bin/python",
"args": ["-m", "gravitas_mcp.server"]
}
}
}
On Windows use YOUR_PATH\\.venv\\Scripts\\python.exe and "args": ["-m", "gravitas_mcp.server"].
Option C — Use uv with project path (no venv path)
If Cursor runs the command with a fixed cwd, you can use:
{
"mcpServers": {
"gravitas-mcp": {
"command": "uv",
"args": ["run", "--project", "/path/to/Gravitas-Core", "python", "-m", "gravitas_mcp.server"]
}
}
}
Replace /path/to/Gravitas-Core with your actual clone path.
Troubleshooting
| Error | Fix |
|---|---|
spawn uvx ENOENT |
Cursor can’t find uvx. Either install UV and ensure uvx is in your PATH, or use localhost: open this repo in Cursor (so it uses the project’s .cursor/mcp.json) and run python3 -m venv .venv && .venv/bin/pip install -e . in the project folder. The project config uses the venv’s Python, so no uv needed. |
| Server not starting | Ensure .venv exists: from the project root run python3 -m venv .venv then .venv/bin/pip install -e . (or uv sync if you have uv). |
MCP client configuration
Blackbox / Cursor (user-level config)
Add to ~/.config/Code/User/globalStorage/blackboxapp.blackboxagent/settings/blackbox_mcp_settings.json:
{
"mcpServers": {
"gravitas-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/ahmed-coding/Gravitas-Core.git",
"Gravitas-Core-MCP"
]
}
}
}
With a specific ref (branch or tag):
{
"mcpServers": {
"gravitas-mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/ahmed-coding/Gravitas-Core.git@v1.1.0",
"Gravitas-Core-MCP"
]
}
}
}
From local clone:
{
"mcpServers": {
"gravitas-mcp": {
"command": "/path/to/Gravitas-Core/.venv/bin/python",
"args": ["-m", "gravitas_mcp.server"],
"env": {
"PYTHONPATH": "/path/to/Gravitas-Core"
},
"type": "stdio"
}
}
}
Cursor (project-level config)
Add to .cursor/mcp.json or .vscode/mcp.json:
{
"mcpServers": {
"gravitas-mcp": {
"command": "uvx",
"args": ["Gravitas-Core-MCP"]
}
}
}
Repository structure
Gravitas-Core-MCP/
├── gravitas_mcp/
│ ├── __init__.py
│ ├── server.py # MCP entrypoint, tool wiring
│ ├── memory.py # SQLite persistence, task ledger, state APIs
│ ├── controller.py # State machine, retry/rollback
│ ├── terminal.py # Subprocess execution, allowlist/denylist
│ ├── browser.py # Playwright automation
│ └── project_intel.py # Structure analysis, noise filtering
├── pyproject.toml
├── README.md
├── LICENSE
└── .gitignore
Tool contract
All tools return deterministic JSON:
{
"status": "success | failure",
"observations": {},
"errors": [],
"next_recommended_action": ""
}
Mandatory tools (PRD)
| Tool | Description |
|---|---|
get_last_state |
Last known state (snapshot + active task) |
get_canonical_state |
Last verified immutable state (rollback/recovery) |
record_failure |
Record failed strategy/command |
resume_task |
Load task context for resumption |
controller_create_task |
Create task, state PLANNING |
controller_transition |
Move task to PLANNING/CODING/EXECUTING/VERIFYING/FAILED_RETRY/ROLLBACK/COMPLETED |
controller_record_step_failure |
Record step failure (may trigger rollback) |
terminal_execute |
Run shell command with timeout |
browser_navigate / browser_snapshot / browser_screenshot |
UI verification |
project_get_map |
Project structure with noise filtering |
get_model_resume_package |
Model handover package |
Brain database
State is stored in .gravitas_brain.db in the project root (or cwd). Optional: add .gravitas_brain.db to .gitignore if you do not want to commit it.
License
MIT — Local-first, user-sovereign, safe by default.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。