mcp-own-your-code

mcp-own-your-code

khirodsahoo93

MCP server for recording function intent, decisions, and evolution in your codebase. Works with Cursor, Claude Desktop,

An MCP server that maintains a living intent ledger for codebases, capturing the 'why' behind every function with decision logs and evolution timelines.

169 viewsLocal (stdio)

About mcp-own-your-code

mcp-own-your-code is a community-built MCP server published by khirodsahoo93 that provides AI assistants with tools and capabilities via the Model Context Protocol. MCP server for recording function intent, decisions, and evolution in your codebase. Works with Cursor, Claude Desktop, It is categorized under search web. This server exposes 10 tools that AI clients can invoke during conversations and coding sessions.

How to install

You can install mcp-own-your-code in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

License

mcp-own-your-code is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

Tools (10)

register_project

Register a project directory for intent tracking

record_intent

Record the intent and reasoning behind a function

explain_function

Retrieve the full story of a function including original intent and changes

update_intent

Update existing intent record for a function

search_functions

Search functions by keyword, semantic similarity, or hybrid approach

Own Your Code

A living intent ledger for your codebase.
Capture the why behind every function — via MCP — and explore it in a browser or over REST.

PyPI Python 3.11+ License MIT GitHub

Own Your Code is an open-source Model Context Protocol (MCP) server and optional FastAPI + React web app that maintains an intent ledger (SQLite). For each function in your codebase, it captures why it exists, what tradeoffs were considered, and how it has evolved over time — making your codebase understandable to both humans and AI.

Works with: Cursor, Claude Desktop, Claude Code, Windsurf, VS Code (with MCP), and any other MCP-capable host.

Package name: own-your-code on PyPI. Repository: mcp-own-your-code.


Where to find Own Your Code

WhereLink
PyPIpypi.org/project/own-your-code
GitHubgithub.com/khirodsahoo93/mcp-own-your-code
npm shimnpmjs.com/package/own-your-code-mcp

Table of contents

  1. Why Own Your Code?
  2. What you get
  3. Architecture
  4. Requirements
  5. Quick start (5 steps)
  6. Installation
  7. Editor setup (per-editor)
  8. Your first session
  9. MCP tools reference
  10. Terminal CLI reference
  11. Web UI and REST API
  12. REST API reference
  13. Search modes
  14. Optional extras
  15. Environment variables
  16. Post-write hook
  17. Long-running tools and limits
  18. Production deployment
  19. Development
  20. Database schema
  21. Troubleshooting
  22. Publishing (maintainers)
  23. Documentation map
  24. License

Why Own Your Code?

Code explains what — your history of decisions explains why. When you return to a function six months later (or when an AI tries to help you change it), the context is gone. Reviewers ask "why is this here?" Pull requests lose the reasoning thread.

Own Your Code solves this by making intent capture a first-class part of your workflow:

  • Every time you write or modify a function, record why it exists and what decision you made.
  • When you return to it later, explain_function surfaces the full story — original request, decisions, every change with its reason.
  • The codebase map shows coverage (what % of functions have intent recorded) and highlights what still needs annotation.
  • Semantic search lets you find functions by purpose, not just name.

What you get

FeatureDescription
Intent captureRecord user request, reasoning, implementation notes, confidence level per function.
Decision logCapture tradeoffs and alternatives considered at decision time.
Evolution timelineAppend a change entry whenever behavior is modified; Git hash is captured automatically.
Multi-language indexingPython (built-in), TypeScript, JavaScript, Go (via optional tree-sitter).
Three search modesKeyword (fast), semantic (embedding-based), hybrid (blended).
Coverage mapSee which functions are annotated and which still need attention.
MCP surfaceAI agents call tools directly from the editor.
CLI surfaceSame database, same project — use from the terminal without an AI host.
FastAPI + React UIBrowse the map, search, inspect timelines in a browser.
Post-write hookEditor hook populates a backlog of files to annotate after each write.

Architecture

flowchart LR
  subgraph ai["AI Host (editor)"]
    Cursor["Cursor / Claude / Windsurf"]
  end
  subgraph mcp["MCP Process"]
    Srv["own-your-code-mcp (stdio)"]
  end
  subgraph web["Optional web stack"]
    API["FastAPI api.main"]
    UI["React UI (ui/dist)"]
  end
  DB[(SQLite ledger<br/>owns.db)]

  Cursor -->|"JSON-RPC over stdio"| Srv
  Srv --> DB
  Browser --> API
  API --> DB
  API --> UI

Key points:

  • The MCP server and the REST API share one SQLite file (path from OWN_YOUR_CODE_DB, or a default location).
  • One MCP binary serves all your projects. The active project is always identified by project_path on each tool call.
  • The web stack (FastAPI + React) is optional — MCP works without it.

Requirements

  • Python 3.11, 3.12, or 3.13 — all tested in CI.
  • Node.js 18+ — only needed if you build the React UI from source.
  • No database server — SQLite is embedded.

Quick start (5 steps)

StepWhat to do
1Install: pipx install own-your-code
2Wire your editor: own-your-code install (or see per-editor setup)
3Restart your editor so it picks up the new MCP config
4In the AI chat, call register_project with the path to your repo
5While coding, call record_intent after every function you write or change

Installation

Option A — pipx (recommended for most users)

pipx installs CLI tools in isolation and puts them on your PATH automatically.

pipx install own-your-code
own-your-code install          # writes MCP config for your editor

First time: follow the prompt if pipx asks you to add ~/.local/bin to PATH.

Option B — pip in a virtual environment

python3 -m venv ~/.venvs/oyc
source ~/.venvs/oyc/bin/activate    # Windows: .venvs\oyc\Scripts\activate
pip install own-your-code
own-your-code install

When you configure your editor, use the full path to the binary:

which own-your-code-mcp    # copy this path into the MCP config command

Option C — npm shim (still requires Python 3.11+)

npx own-your-code-mcp install

This checks for the Python package, installs it if needed, then runs own-your-code install. Prefer the native Python binary for lower latency.

Option D — from source

git clone https://github.com/khirodsahoo93/mcp-own-your-code
cd mcp-own-your-code
python3 -m venv .venv && source .venv/bin/activate
pip install -e .

# Optional extras:
pip install -e ".[semantic]"       # semantic/hybrid search
pip install -e ".[full]"           # semantic + TypeScript/JavaScript/Go indexing
pip install -e ".[dev,full]"       # full + pytest + ruff

Optional extras

ExtraWhat it adds
pip install "own-your-code[semantic]"sentence-transformers, numpy — needed for semantic/hybrid search
pip install "own-your-code[multilang]"tree-sitter grammars for TypeScript, JavaScript, Go
pip install "own-your-code[full]"Both semantic and multilang
pip install "own-your-code[dev]"pytest, httpx, ruff — for contributors

Editor setup (per-editor)

After installing, run own-your-code install --platform <id> to write the MCP config automatically. Or use own-your-code print-config to get the JSON and merge it manually.

Always restart the editor after changing MCP config.

Cursor

own-your-code install --platform editor-a

Edits ~/.cursor/mcp.json. Manual config:

{
  "mcpServers": {
    "own-your-code": {
      "command": "own-your-code-mcp",
      "args": [],
      "env": {}
    }
  }
}

If own-your-code-mcp is not on PATH (pip in venv, no pipx), use the full path instead:

{
  "mcpServers": {
    "own-your-code": {
      "command": "/Users/you/.venvs/oyc/bin/own-your-code-mcp",
      "args": [],
      "env": {}
    }
  }
}

Claude Desktop

own-your-code install --platform editor-b

Edits ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).

Windsurf / Codeium

own-your-code install --platform editor-c

Edits ~/.codeium/windsurf/mcp_config.json.

Claude Code CLI

own-your-code install --platform claude-code

Edits ~/.claude.json.

VS Code with MCP extension

Use own-your-code print-config to get the server block and add it to your MCP configuration file per your extension's docs.

All editors at once

own-your-code install --platform all

Check without writing

own-your-code install --dry-run

From a git checkout (not a pip/pipx install)

{
  "mcpServers": {
    "own-your-code": {
      "command": "/path/to/mcp-own-your-code/.venv/bin/python",
      "args": ["-m", "src.server"],
      "cwd": "/path/to/mcp-own-your-code"
    }
  }
}

Your first session

This section shows a realistic workflow: registering a project, recording intent while writing code, and retrieving it later.

1. Register your project

In the AI chat:

register_project path="/Users/you/projects/my-app"

This walks the directory tree, extracts every function in Python/Ty


README truncated. View full README on GitHub.

Alternatives

Related Skills

Browse all skills
google-official-seo-guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

101
ux-writing

Create user-centered, accessible interface copy (microcopy) for digital products including buttons, labels, error messages, notifications, forms, onboarding, empty states, success messages, and help text. Use when writing or editing any text that appears in apps, websites, or software interfaces, designing conversational flows, establishing voice and tone guidelines, auditing product content for consistency and usability, reviewing UI strings, or improving existing interface copy. Applies UX writing best practices based on four quality standards — purposeful, concise, conversational, and clear. Includes accessibility guidelines, research-backed benchmarks (sentence length, comprehension rates, reading levels), expanded error patterns, tone adaptation frameworks, and comprehensive reference materials.

24
browser-automation

Automate web browser interactions using natural language via CLI commands. Use when the user asks to browse websites, navigate web pages, extract data from websites, take screenshots, fill forms, click buttons, or interact with web applications. Triggers include "browse", "navigate to", "go to website", "extract data from webpage", "screenshot", "web scraping", "fill out form", "click on", "search for on the web". When taking actions be as specific as possible.

21
last30days

Research a topic from the last 30 days on Reddit + X + Web, become an expert, and write copy-paste-ready prompts for the user's target tool.

20
web-research

Use this skill for requests related to web research; it provides a structured approach to conducting comprehensive web research

18
research

Comprehensive research, analysis, and content extraction system. USE WHEN user says 'research' (ANY form - this is the MANDATORY trigger), 'do research', 'extensive research', 'quick research', 'minor research', 'research this', 'find information', 'investigate', 'extract wisdom', 'extract alpha', 'analyze content', 'can't get this content', 'use fabric', OR requests any web/content research. Supports three research modes (quick/standard/extensive), deep content analysis, intelligent retrieval, and 242+ Fabric patterns. NOTE: For due diligence, OSINT, or background checks, use OSINT skill instead.

12