Codex Harness MCP
Enables web searches through DuckDuckGo, allowing agents to retrieve search results from the internet.
Provides access to OpenAI Codex agent tasks, including executing shell commands, applying patches, viewing images, searching the web, and managing files under configurable permission modes.
Click on "Install 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., "@Codex Harness MCPRun shell to list changed files and show me the git diff"
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.
A Harness MCP — Codex-style Autonomous Programming Agent Service
A Harness MCP is a local server program based on the Model Context Protocol (MCP). It exposes Codex Harness's layered context, skill system, and autonomous Agent capabilities to external AI clients (such as Claude Desktop, DeepSeek, etc.) in the form of MCP tools. Through this service, external AI can execute code, read and write files, call external tools in your local project, and complete complex programming tasks in a structured way.
✨ Core Features
Layered Context Assembly — Drawing on the Codex Harness design, it layers base behavioral guidelines, user-level AGENTS.md, project-level AGENTS.md, and skill indexes. The workflow conventions can be freely edited by users and are not hardcoded into the program.
Skill System — Supports defining standalone skills under the project
.a_harness_mcp/skills/directory, loading full instructions on demand via theget_skilltool to reduce context redundancy.Rich Built-in Toolset — Provides shell command execution, file read/write, directory browsing, patch application, image viewing, web search, MCP server management, and more.
Codex Agent Integration — Includes a built-in
codextool that can directly delegate complex coding tasks to the Codex Agent, with timeout control and custom model support.External MCP Server Proxy — Through the
mcp_servers.jsonconfiguration, third-party MCP servers (such as Excel, SSH, AMap, etc.) can be uniformly proxied and integrated into the tool list.Graphical Control Interface — Provides a PyQt5-based GUI program for configuring project directories, permission modes, host ports, model parameters, and viewing service logs and AI interaction records in real time.
Lightweight Test Client — Includes
mcp_client_test.pyimplemented purely with the standard library, requiring no third-party dependencies to verify service availability.
Related MCP server: MCP Server
🚀 Quick Start
Start the Server
# 启动 GUI 控制界面
python codex_mcp_gui.py
# 或直接启动 HTTP 服务(无 GUI)
python codex_mcp_server.pyConnect an MCP Client
The service provides an MCP Streamable HTTP endpoint at http://127.0.0.1:9999/mcp by default, supporting connections from any MCP-compatible client.
Verify with the Smoke Test Client
# 握手并列出所有可用工具
python mcp_client_test.py
# 调用 shell 工具执行 dir 命令
python mcp_client_test.py --tool shell --args '{"command":"dir"}'
# 调用 codex 工具执行编程任务
python mcp_client_test.py --tool codex --args '{"prompt":"读取当前目录所有 Python 文件并统计总行数"}'Configure in Claude Desktop
Add the following to the Claude Desktop configuration file:
{
"mcpServers": {
"a-harness-mcp": {
"url": "http://127.0.0.1:9999/mcp"
}
}
}📦 Available Tools
Tool Name | Description |
| Execute shell commands in the project directory (subject to permission mode) |
| Launch a Codex Agent to complete coding tasks (nested Agent) |
| Read text files within the project |
| Write text files within the project (disabled in read-only mode) |
| List directory contents within the project |
| Apply git-style unified diff patches |
| View base64-encoded images or images under a project path |
| Online search (via the DuckDuckGo web interface) |
| Return the currently injected full context (workflow rules + skill index) |
| List skills available to the project |
| Load the full SKILL.md description of a specified skill on demand |
| Long-term memory management (user preferences, behavior corrections, discussion points, etc.) |
| Create a custom Skill draft pending review |
| Preview and import external memory data |
🧩 Skill System (Skills)
Skills are project-level reusable capability units stored in .a_harness_mcp/skills/<skill-name>/SKILL.md.
Each skill file declares metadata using frontmatter:
---
name: pdf-analyzer
description: 提取 PDF 文档中的表格和关键信息,适用于财务报告分析
---
# PDF 分析技能
## 使用场景
...When external AI initializes, only the skill's name and description are loaded as an index; the full body is fetched on demand via get_skill, greatly reducing context window usage.
🎛️ Permission Modes
Mode | Description |
| Read-only mode, all write operations are prohibited |
| Allows reading, writing, and executing commands within the workspace |
| Full workspace permissions with no additional restrictions |
Permission modes can be switched via the GUI dropdown menu or service startup parameters.
📁 Layered Context Assembly Mechanism
When the service starts, it automatically assembles the following context and injects it into the external AI as initial instructions:
Base Behavioral Guidelines — Built-in Codex-style guidelines (tool specifications, autonomy, quality requirements)
User-level Workflow Conventions —
~/.a_harness_mcp/AGENTS.md(a default template is auto-generated on first run and can be freely edited)Project-level Workflow Conventions —
<project>/AGENTS.mdor<project>/.a_harness_mcp/AGENTS.md(takes priority over the user level)Skill Index — Scans the
.a_harness_mcp/skills/directory and aggregates the names and descriptions of all skills
🔌 External MCP Server Proxy
Through the mcp_servers.json configuration file, third-party MCP servers can be proxied into this service:
[
{
"name": "excel",
"enabled": true,
"config": {
"mcpServers": {
"excel": {
"command": "npx",
"args": ["-y", "@zhiweixu/excel-mcp-server"],
"env": { "CACHE_MAX_AGE": "1" },
"type": "stdio"
}
}
}
}
]Proxied tools are uniformly registered into the tool list, and external AI can call them directly.
🧪 Development and Testing
Installing Dependencies
pip install PyQt5Running Tests
# 启动服务(GUI 或非 GUI 模式)
python codex_mcp_gui.py
# 另开终端执行冒烟测试
python mcp_client_test.py🗂️ Project Structure
.
├── A Harness MCP.exe # PyInstaller 打包的可执行文件
├── codex_mcp_gui.py # PyQt5 GUI 控制界面
├── codex_mcp_server.py # MCP HTTP 服务核心实现
├── context.py # 分层上下文装配器
├── mcp_plugins.py # 外部 MCP 服务器代理与插件管理
├── mcp_client_test.py # 纯标准库 MCP 客户端冒烟测试
├── mcp_servers.json # 外部 MCP 服务器配置
└── codex_mcp_gui_config.json # GUI 配置文件(项目目录、端口、权限模式等)📄 License
🤝 Contributing
Issues and Pull Requests are welcome. Before submitting code, please ensure:
Existing code style is followed
New features come with corresponding test cases
Related documentation is updated
Made with ❤️ for local AI Agent development.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityAmaintenanceMCP server that lets AI models invoke CLI agents (Gemini, Codex, Claude, OpenCode) as tools — with parallel execution, retries, and structured output parsing.55MIT
- FlicenseNot gradedqualityCmaintenanceA secure Model Context Protocol server providing HTTP endpoints for AI agent tool execution, including file system operations, shell commands, and LLM-based code generation.1
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to discover and execute tools via a secure MCP server with JWT authentication, RBAC, rate limiting, and audit logging.1MIT
- AlicenseNot gradedqualityCmaintenanceRemote execution layer for agentic systems exposing 64 production tools via MCP for file, network, system, text, git, crypto, and monitoring operations.MIT
Related MCP Connectors
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
MCP server for Clipkit — gives AI agents a video toolbox via the Clipkit schema.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/2091k/A_Harness_MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server