Note: CodeScribe is intended as an example project for how to create MCP servers in both JavaScript and Python. The project is in a very early, experimental phase. It demonstrates both deterministic tools and tools that use AI, and will likely include additional features such as resource management in the future.
CodeScribe is an educational example of how to build Model Context Protocol (MCP) servers in both JavaScript and Python. It is intended for developers interested in agent tool design, MCP integration, and hybrid deterministic/AI workflows.
- Journaling: Log free-form notes, ideas, reminders, and comments to a daily journal file.
- Summarization: Use OpenAI to summarize a day's journal entries.
- Categorization: Use OpenAI to tag/categorize journal entries by theme (e.g., bug, idea, decision, question).
- MCP Server: Exposes tools via MCP protocol for integration with compatible hosts (e.g., VS Code, custom clients).
- Command-Line Interface: All tools are available via CLI for quick local use.
- Extensible: Designed to be extended with new tools, including deterministic and AI-powered ones.
- Journal entries are appended to
.journal/YYYY-MM-DD.txtin your project root. - Each entry is timestamped:
[HH:MM:SS] your note here - Summarization and categorization use OpenAI's GPT models (requires API key).
You can add new tools by editing codescribe/agent.py (Python) or codescribe-agent.js (JavaScript). Tools can be deterministic (pure code) or use AI models. See the source for examples of both.
- Missing API Key: Ensure
OPENAI_API_KEYis set in your.envor environment. - MCP Not Connecting: Check your
.vscode/mcp.jsonconfiguration and that only one agent is running at a time. - Python Dependencies: Use
uv syncto install all required packages.
- Model Context Protocol (MCP)
- LangChain.js
- LangChain Python (Not used in the Python example)
- OpenAI API
npm installUses LangChain.js together with the MCP SDK.
uv syncFor node.js we use the default npm package manager. For Pyhthon you will need to install Uv
Start the MCP server with:
node codescribe-agent.js mcpStart the Python server with:
python -m codescribe mcpEach version listens on stdin/stdout so it can be invoked by any MCP-compliant host. Entries are appended to .journal/YYYY-MM-DD.txt in the form [HH:MM:SS] message.
Once running, send an MCP callTool request with your instruction. The agent logs the note and returns a confirmation message.
The Python version can run tools directly from the command line:
python -m codescribe log "my note here"
python -m codescribe summarize # summarize today's journal
python -m codescribe summarize 2024-05-01
python -m codescribe tag 2024-05-01 # categorize entries
python -m codescribe mcp # start MCP serverFor the Javascript version you need to use the same commands but using node to run the script, for example:
node codescribe-agent.js log "my note here"
# etc..Add the following to .vscode/mcp.json depending on the implementation you want to run:
{
"servers":{
"codescribe-js": {
"type": "stdio",
"command": "node",
"args": ["./codescribe-agent.js"]
},
"codescribe-py": {
"type": "stdio",
"command": "uv",
"args": ["run",
"--directory",
"${workspaceFolder}",
"-m",
"codescribe",
"run"
]
}
}
}This configuration ensures the Python agent is started correctly as an MCP server using uv.
This tells your MCP-compatible tools how to launch the agent locally. Make sure the .vscode/mcp.json file is located in the project root. Only use one of the two implementation as otherwise Github Copilot might get confused about which Agent to run.
You can also obtain a released version with pipx. Run for example:
pipx install https://github.com/soyrochus/codescribe/releases/download/v0.1.0/codescribe-0.1.0-py3-none-any.whl in case of the v0.1.0 release. See the repo's releases page to obtain the url to the latest on or any other particular release.
-
Create a
.envfile in the project root containing your OpenAI API key:OPENAI_API_KEY=your_key_here
-
Alternatively, set the
OPENAI_API_KEYenvironment variable:export OPENAI_API_KEY=your_key_here
Copyright (c) 2025, Iwan van der Kleijn
This project is licensed under the MIT License. See the LICENSE file for details.