smart-coding-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@smart-coding-mcp recall project conventions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
smart-coding-mcp
A stateful coding-analysis MCP server that gives your AI coding assistant persistent memory, deterministic code checks, and a curated rules file that grows with your project.
Try it |
|
Wire it up | drop the JSON in § Wire into your editor into your editor's |
Status | v0.2.x · Beta · 55 tests green · CI on Linux / macOS / Windows |
License | MIT |
Quick start (30 seconds)
If you just want to see it work:
uvx smart-coding-mcp doctorThat downloads the package from PyPI, runs the diagnostic in an
ephemeral Python env, and prints a report. If you see [ok] lines,
you're set up.
To wire it into your editor (Kimi Code, Claude Code, Cursor, anything MCP-aware), save the snippet below to the path your editor reads:
{
"mcpServers": {
"smart-agent": {
"command": "uvx",
"args": ["smart-coding-mcp"]
}
}
}Editor | Config file |
Kimi Code |
|
Claude Code |
|
Cursor |
|
Claude Desktop | use |
Start a new session. The orchestrator will start using the lesson store automatically; there's nothing else to wire up.
If anything fails, jump to Troubleshooting.
Related MCP server: CodeImpact
What is this?
A stateful coding-analysis MCP specialist for the Kimi Code (and
Claude Code / Cursor / any MCP-aware orchestrator) agent loop. It
holds a persistent lesson store, runs deterministic static checks the
LLM shouldn't be trusted with, and helps a project evolve a curated
rules file (AGENTS.md) over time.
The agent itself does not call any LLM. Every "intelligence" call comes from the orchestrator. Its job is to:
Hold persistent state across sessions.
Run deterministic checks the LLM can't be trusted with.
Make past lessons trivially retrievable so the orchestrator applies them.
That's what "evolution" looks like today: persistent lessons + an orchestrator that follows the recall-at-start / record-at-end convention (see § Convention).
Install
Three ways — pick the one that fits.
1. From PyPI (recommended for users)
The package is on PyPI as smart-coding-mcp. You can run it
ephemerally (uvx) or install it persistently (pip / uv add).
Run without installing — uvx pulls the latest published wheel
into a throwaway env, runs the command, then discards the env:
uvx smart-coding-mcp # start the MCP server (default subcommand)
uvx smart-coding-mcp doctor # one-shot diagnostic
uvx smart-coding-mcp --help # list subcommandsInstall into your current Python env:
pip install smart-coding-mcp # runtime only
pip install "smart-coding-mcp[dev]" # also installs pytest + ruffCross-platform: works on Linux, macOS, and Windows. Python 3.10+ required.
⚠️ Important name note. Always type
smart-coding-mcp(with the-mcpsuffix). PyPI hosts another package calledsmart-agentowned by someone else;uvx smart-agent doctorresolves to that one and crashes withModuleNotFoundError: readlineon Windows. See Troubleshooting.
2. From source (for active development)
Use this when you want to modify the code.
git clone https://github.com/cbuntingde/smart-agent
cd smart-agent
uv sync
uv run smart-coding-mcp # == uv run smart-coding-mcp serve
uv run smart-coding-mcp doctorEdits land in the next session without re-installing.
3. Local-path wiring (when running from a working tree)
Same as option 2, but Kimi Code's mcp.json points directly at the
working tree so any unsaved changes are live:
{
"mcpServers": {
"smart-agent": {
"command": "uv",
"args": [
"--directory", "/path/to/smart-agent",
"run", "smart-coding-mcp"
]
}
}
}In all three paths the entry point is the same: smart-coding-mcp,
with subcommands serve (default), doctor, --help.
Wire into your editor
smart-coding-mcp speaks the Model Context Protocol over stdio.
Any MCP-aware client can use it.
Kimi Code
~/.kimi-code/mcp.json:
{
"mcpServers": {
"smart-agent": {
"command": "uvx",
"args": ["smart-coding-mcp"]
}
}
}Claude Code
claude mcp add --transport stdio smart-coding-mcp -- uvx smart-coding-mcpCursor
~/.cursor/mcp.json:
{
"mcpServers": {
"smart-coding-mcp": {
"command": "uvx",
"args": ["smart-coding-mcp"]
}
}
}Claude Desktop / Web
Streamable HTTP isn't directly supported in the connector UI. Wrap the
stdio server with mcp-remote:
npm install -g mcp-remoteThen in Claude Desktop's custom connector config:
{
"smart-coding-mcp": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://search.parallel.ai/mcp"]
}
}Replace smart-coding-mcp endpoint accordingly — Claude Desktop's
connector dialog accepts the mcp-remote --stdio uvx ... wrapper if you
point it at a stdio script.
Verify it works
uvx smart-coding-mcp doctorIf you see [ok] lines for paths, DB, and store stats — and your
editor's mcp.json is in place — you're done.
What you get
Capability | How |
Persistent memory across sessions | SQLite + FTS5 lesson store at |
Deterministic static analysis |
|
Subprocess linters and tests |
|
Living conventions file |
|
Recall-at-start / record-at-end loop |
|
The orchestrator's LLM does the reasoning. This agent is the stateful, deterministic scaffolding around it.
Platforms
Platform | Tested in CI |
Linux (Ubuntu) | ✅ |
macOS | ✅ |
Windows | ✅ |
Python 3.10, 3.11, 3.12, 3.13 all tested.
Production readiness
Concern | Where |
Schema evolution |
|
Crash safety | Per-operation SQLite connections (no shared long-lived handle). WAL + |
Logging | stdlib |
Monitoring |
|
Input validation | All tool params go through FastMCP's Pydantic schema; the store enforces caps on summary (500), evidence (2 000), tag count (32), tag CSV length (500). |
Security | See |
Reproducibility |
|
Architecture
See ARCHITECTURE.md for a deeper dive (module map,
data flow diagram, schema versioning protocol, logging conventions,
configuration env vars, what-it-doesn't list).
In one sentence: the orchestrator talks to this server via MCP; the
server holds a SQLite store and an AGENTS.md file; the server never
calls an LLM.
Tools
14 MCP tools, organised by what they do:
Purpose | Tools |
Memory — write |
|
Memory — read |
|
Conventions |
|
Static analysis |
|
Diagnostics |
|
Plus three resources (memory://recent, memory://stats,
conventions://current) and one prompt (code_review).
Full list: ARCHITECTURE.md.
Convention: recall-at-start / record-at-end
The agent gets smarter only if the orchestrator follows this discipline:
BEFORE tackling a task:
1. Call recall_lessons(query=task_topic, k=5)
2. Read conventions://current
3. Apply each relevant rule before flagging it as a new finding
AFTER each non-trivial task (or whenever you learn something reusable):
1. Call record_lesson(category, summary, evidence, tags)
— keep summary atomic (~80 chars)
— category ∈ bug, style, perf, convention, debt, risky, win
— tags comma-separated, no spaces within tags
2. If the lesson is project-wide, also call set_convention(...)
— plain English, 1-3 sentencesThe MCP server's instructions field repeats this so any MCP-aware
orchestrator gets the reminder at session start.
What's possible — and what isn't
Goal | Status |
Persistent memory across sessions | ✅ SQLite + FTS5 lesson store |
Deterministic static analysis | ✅ built-in |
Subprocess linters and tests | ✅ |
Living conventions file | ✅ |
Recall-at-start / record-at-end loop | ✅ |
Code self-modification of the agent itself | ❌ not shipping in any production tool |
Online weight learning | ❌ not production-stable |
True evolutionary self-improvement | ❌ research-only |
The agent doesn't try to do the impossible — it does the things that actually compose to "smarter over time": lessons persist, the orchestrator applies them, the orchestrator records new ones, the conventions file grows.
Caveats — known limits
Honest list of what's still imperfect as of v0.2.x:
Multi-user / shared
AGENTS.md. Every entry is appended; no merge logic or ownership tracking. Treat as single-author.Prompt injection. Convention text ends up in the orchestrator's context (the orchestrator decides how — this server doesn't write to LLM prompts directly). Treat
AGENTS.mdlike any user-supplied file that ends up in an LLM prompt.Large codebases.
analyze_pathwalks the FS with a default cap of 5 000 files and skips files > 1 MB. Passfocus="risk"for huge codebases.Concurrency. Single-process SQLite. Multi-writer contention is rare in practice but possible if you point several long-lived MCP servers at the same DB file.
Found a sharp edge? Open an issue or fix it inline and PR — the code
is short on purpose. See CONTRIBUTING.md.
Troubleshooting
Symptom | Likely cause | Fix |
| PyPI has another | Use |
| The other |
|
|
| Switch the entry to |
| You typed | Pick one form: bare |
| Optional — |
|
| The conventions file is created lazily on first | Expected — call |
Permission errors on Windows when running tests via | The previous |
|
Storage
Path | Purpose |
| SQLite DB |
| SQLite DB |
| Curated conventions file (track in git!) |
Override the data dir with SMART_AGENT_HOME=/path/to/dir.
Run diagnostics
uvx smart-coding-mcp doctorValidates paths, DB integrity, linter availability, and store contents. Exit 0 = OK; 1 = a hard error. WARN lines don't fail the doctor.
Equivalent MCP tool (callable from a running session):
doctor_tool() returns the same report as a string.
Tests
uv run pytest # in the source tree55 tests across tests/test_{store,analyzer,server,server_new,lint, reflector,doctor,cli}.py. There's also a real-subprocess stdio
handshake verifier:
uv run python smoke_stdio.pyThe CI matrix in .github/workflows/ci.yml
runs both, plus uv build and twine check, on Linux, macOS, and
Windows against Python 3.10–3.13.
Contributing
PRs welcome. See CONTRIBUTING.md for dev setup,
PR checklist, and release process. Security issues: see
SECURITY.md.
Roadmap
Semantic recall via
sqlite-vec(embedding-based search for >10k lessons)Per-project isolation (multi-tenant the SQLite by
project_root)reflectworker that proposes a newAGENTS.mddraft as a separate, optional toolDSPy GEPA / MIPROv2 offline prompt optimisation against measured "what worked / didn't" sets
License
MIT — see LICENSE. © 2026 cbunt.
Available Tools
14 toolsanalyze_pathB
Run deterministic static checks. Returns Markdown report + raw findings list.
Inputs: path, focus, max_files. Returns: object
by_categoryA
Return lessons filtered by category (most-recent first).
Inputs: category (required), limit. Returns: result
doctor_toolA
Same report as smart-agent doctor CLI, returned as a string.
Useful when the orchestrator wants to spot-check the installation during a session.
Inputs: no named parameters. Returns: result
get_conventionsA
Return the full AGENTS.md content (auto-curated project conventions).
Inputs: no named parameters. Returns: result
health_checkA
Return a structured JSON snapshot for monitoring.
Fields: ok boolean — always true if the store could be opened schema_version stored schema_version current_schema version this code expects wal_mode WAL / journal-mode status db_path absolute path to the SQLite file db_size_bytes file size on disk lessons_total row count in the lessons table conventions_path where AGENTS.md lives conventions_writable bool — whether AGENTS.md can be appended to
Use this for liveness/readiness checks, not for hot-path validation.
Inputs: no named parameters. Returns: object
lint_checkA
Run external linter(s) and test runner; return findings + summary.
Each tool maps to the same Finding shape the built-in analyzer uses, with
source set to the tool name (e.g. 'ruff', 'pytest'). Tools not on PATH
are skipped with a reason field, not raised as errors.
Inputs: path, runs, timeout_seconds. Returns: object
mark_lesson_usedA
Bump times_used on a lesson — call when you actually applied it.
Inputs: lesson_id (required). Returns: object
propose_fixA
Suggest a fix sketch by combining the issue with k similar past lessons.
This is deterministic text-stitching — no LLM is called. The orchestrator (which has the LLM) reads the result and decides whether to apply.
Inputs: issue_summary (required), k. Returns: result
recall_lessonsA
Recall top-k lessons matching query (FTS5 retrieval).
Inputs: k, query. Returns: result
recent_lessonsB
Return the most-recent lessons (chronological).
Inputs: limit. Returns: result
record_lessonA
Record a lesson into the persistent store. Returns the new lesson.
Inputs: summary (required), category (required), tags, evidence. Returns: object
reflectA
Return a Markdown draft of new AGENTS.md conventions from recent lessons.
The orchestrator curates which lines to apply by calling set_convention() for each. The agent itself does no LLM calls — the draft is a deterministic aggregation of stored signals (category breakdown, frequently-recurring tags, never-recalled lessons, top-referenced).
Inputs: dry_run, min_count, lookback_n. Returns: result
set_conventionA
Append a new convention to AGENTS.md and return its line number.
Inputs: text (required). Returns: object
store_statsB
Return total and per-category counts.
Inputs: no named parameters. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Most tools have distinct purposes, but there is overlap between analyze_path and lint_check (both analyze code) and between recall_lessons and recent_lessons (both retrieve lessons). Descriptions help differentiate, but ambiguity remains.
Naming conventions are inconsistent, mixing verb_noun (e.g., recall_lessons), noun-only (e.g., health_check), and compound names (e.g., mark_lesson_used). No clear pattern across tools.
14 tools is well within the typical 3-15 range for a focused server, covering lessons, code analysis, and configuration without feeling excessive.
The tool surface covers core CRUD for lessons and static analysis, but lacks a delete lesson tool and an apply fix tool, representing notable gaps for complete workflows.
Related MCP Connectors
Persistent memory and cross-session learning for AI coding assistants (hosted remote MCP).
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
Cloud-hosted MCP server for durable AI memory
Team memory for AI coding agents and code reviews, reviewed by humans and served over MCP.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceAn MCP server that provides persistent project context, workflow management, and knowledge capture for AI coding agents. It enables agents to maintain structured memory across sessions by tracking project profiles, conventions, skills, and technical debt.7-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that indexes your codebase and gives AI assistants persistent understanding of project structure, dependencies, and history across sessions, with a self-improving multi-agent system for continuous code quality enhancement.6 npm3MIT
- AlicenseBqualityBmaintenanceMCP server providing persistent engineering memory and spec-driven development workflows for AI coding agents, preserving learnings across sessions.41Business Source 1.1
- AlicenseNot gradedqualityDmaintenanceMCP server that provides persistent memory and contextual awareness to language models, enabling project onboarding, recall of architectural rules, and code consistency across sessions.32MIT