Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

16 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

JCode v3.0 - MCP-Based Agent Governance System

Python FastAPI MCP License

JCode is a 6-step governance workflow system for AI coding assistants, exposed via the Model Context Protocol (MCP). It brings structure, accountability, and quality control to AI-generated code.

Features โ€ข Quick Start โ€ข Documentation โ€ข Installation


๐ŸŽฏ What is JCode?

JCode implements a complete governance layer that ensures AI-generated code meets quality standards through a structured 6-step workflow:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Analyst   โ”‚ โ†’ โ”‚   Planner   โ”‚ โ†’ โ”‚ Implementer โ”‚
โ”‚  (ๅธ้ฉฌ่ฟ)   โ”‚   โ”‚   (ๅ•†้ž…)    โ”‚   โ”‚   (้ฒ็ญ)    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                              โ†“
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Conductor  โ”‚ โ† โ”‚    Tester   โ”‚ โ† โ”‚   Reviewer  โ”‚
โ”‚  (้Ÿฉ้žๅญ)   โ”‚   โ”‚   (ๅผ ่กก)    โ”‚   โ”‚   (ๅŒ…ๆ‹ฏ)    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Each step validates the previous, ensuring only high-quality code reaches production.


โœจ Features

6 Specialized Agents

Agent Role Output
@jcode-analyst Problem analysis & risk assessment Analysis + Verifiability
@jcode-planner Task decomposition & planning Verifiable task list
@jcode-implementer Code implementation Code changes
@jcode-reviewer Code review APPROVED / REJECTED
@jcode-tester Test verification PASSED / FAILED
@jcode-conductor Final arbitration DELIVER / ITERATE / STOP

MCP Protocol Integration

  • Standard Protocol: Implements Model Context Protocol (JSON-RPC 2.0)
  • Tool Discovery: Auto-discoverable by MCP clients
  • Stateless Design: Each invocation is independent
  • Multi-Client Support: Works with OpenCode, VSCode, Claude Desktop, etc.

Auto-Start Options

  • โœ… VSCode auto-start on project open
  • โœ… System service (systemd/launchd)
  • โœ… Docker container
  • โœ… PM2 process management

๐Ÿš€ Quick Start

1. Installation

git clone https://github.com/jabing/JCode.git
cd JCode
pip install -r requirements.txt

2. Configure OpenCode (or your MCP client)

Edit ~/.config/opencode/opencode.json:

{
  "mcp": {
    "jcode": {
      "type": "local",
      "command": ["python", "-m", "jcode_mcp.server", "--port", "8080"],
      "env": {"PYTHONPATH": "/path/to/jcode"},
      "enabled": true
    }
  }
}

3. Use JCode

In your MCP client:

@jcode ๅฎž็Žฐไธ€ไธช็”จๆˆท็™ปๅฝ•ๅŠŸ่ƒฝ

Or use individual agents:

@jcode-analyst ๅˆ†ๆž่ฟ™ไธช้œ€ๆฑ‚็š„้ฃŽ้™ฉ
@jcode-reviewer ๆฃ€ๆŸฅ่ฟ™ๆฎตไปฃ็ 
@jcode-tester ่ฟ่กŒๆต‹่ฏ•

๐Ÿ“š Documentation

Core Documentation

Governance Framework

API Reference


๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  MCP Client                          โ”‚
โ”‚         (OpenCode / VSCode / Claude)                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                     โ”‚ JSON-RPC 2.0
                     โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              JCode MCP Server                        โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚ /health  โ”‚  /mcp    โ”‚ /docs    โ”‚   /openapi    โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  analyze โ”‚ โ”‚   plan   โ”‚ โ”‚ implementโ”‚ โ”‚ review โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                          โ”‚
โ”‚  โ”‚   test   โ”‚ โ”‚ conductorโ”‚                          โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                          โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                     โ”‚
                     โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚               Core Agents                            โ”‚
โ”‚   Analyst / Planner / Implementer / Reviewer /      โ”‚
โ”‚   Tester / Conductor                                โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽจ Agent Personalities

Each JCode agent has a historical Chinese personality anchor that constrains its behavior:

Agent Personality Constraint
Analyst ๅธ้ฉฌ่ฟ (Sima Qian) Records facts only, no judgment
Planner ๅ•†้ž… (Shang Yang) Creates laws, doesn't execute
Implementer ้ฒ็ญ (Lu Ban) Follows blueprint exactly
Reviewer ๅŒ…ๆ‹ฏ (Bao Zheng) Binary verdict only, no suggestions
Tester ๅผ ่กก (Zhang Heng) Provides evidence, no speculation
Conductor ้Ÿฉ้žๅญ (Han Feizi) Final arbiter, no analysis

๐Ÿงช Testing

# Run all tests
pytest tests/ -v

# Run integration tests
pytest tests/integration/test_mcp_server.py -v

# Run with coverage
pytest tests/ --cov=jcode_mcp --cov-report=html

๐Ÿ“ฆ Project Structure

jcode/
โ”œโ”€โ”€ jcode_mcp/              # MCP Server implementation
โ”‚   โ”œโ”€โ”€ server.py           # FastAPI + JSON-RPC 2.0
โ”‚   โ”œโ”€โ”€ jcode_server.py     # Tool definitions
โ”‚   โ””โ”€โ”€ __init__.py
โ”œโ”€โ”€ core/agents/            # 6 Agent implementations
โ”‚   โ”œโ”€โ”€ analyst.py
โ”‚   โ”œโ”€โ”€ planner.py
โ”‚   โ”œโ”€โ”€ implementer.py
โ”‚   โ”œโ”€โ”€ reviewer.py
โ”‚   โ”œโ”€โ”€ tester.py
โ”‚   โ””โ”€โ”€ conductor.py
โ”œโ”€โ”€ config/agents/          # OpenCode Agent configs
โ”‚   โ”œโ”€โ”€ jcode.md            # Primary orchestrator
โ”‚   โ”œโ”€โ”€ jcode-analyst.md
โ”‚   โ”œโ”€โ”€ jcode-planner.md
โ”‚   โ”œโ”€โ”€ jcode-implementer.md
โ”‚   โ”œโ”€โ”€ jcode-reviewer.md
โ”‚   โ”œโ”€โ”€ jcode-tester.md
โ”‚   โ””โ”€โ”€ jcode-conductor.md
โ”œโ”€โ”€ skills/jcode-mcp/       # OpenCode SKILL registration
โ”‚   โ””โ”€โ”€ SKILL.md
โ”œโ”€โ”€ docs/                   # Documentation
โ”‚   โ”œโ”€โ”€ AUTO_START_GUIDE.md
โ”‚   โ”œโ”€โ”€ VSCODE_INTEGRATION.md
โ”‚   โ””โ”€โ”€ TROUBLESHOOTING.md
โ”œโ”€โ”€ governance/             # Governance framework
โ”‚   โ”œโ”€โ”€ AGENT_CONSTITUTION.md
โ”‚   โ””โ”€โ”€ ...
โ””โ”€โ”€ tests/                  # Test suite
    โ””โ”€โ”€ integration/

๐Ÿ›ฃ๏ธ Roadmap

  • MCP Server implementation
  • 6 Agent tools exposed via MCP
  • VSCode integration
  • Auto-start configuration
  • Web dashboard for workflow monitoring
  • Multi-project support
  • Custom agent plugins
  • Enterprise SSO integration

๐Ÿค Contributing

Contributions are welcome! Please read our Contributing Guide for details.

Development Setup

# Install dev dependencies
pip install -r requirements.txt

# Install pre-commit hooks
pre-commit install

# Run linting
ruff check .
black --check .

# Run tests
pytest

๐Ÿ“„ License

MIT License - see LICENSE file for details.


๐Ÿ™ Acknowledgments


๐Ÿ“ž Support


JCode: Governance as a Tool
่ฎฉAIไธๅชๆ˜ฏๅ†™ไปฃ็ ๏ผŒ่€Œๆ˜ฏๅ†™ๅฅฝไปฃ็ 

About

MCP-Based Agent Governance System

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages