PHPackages                             vielhuber/codemcp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. vielhuber/codemcp

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

vielhuber/codemcp
=================

MCP-capable PHP orchestrator for agentic coding via Codex and Claude Code.

1.1.9(2w ago)159MITPHPPHP ^8.3

Since Jun 14Pushed 1w agoCompare

[ Source](https://github.com/vielhuber/codemcp)[ Packagist](https://packagist.org/packages/vielhuber/codemcp)[ RSS](/packages/vielhuber-codemcp/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (4)Versions (21)Used By (0)

[![GitHub Tag](https://camo.githubusercontent.com/80d098e5e3b098794dddd73cc65f5b55d269c53c97a88a5e2f09bc32ef050933/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f7461672f7669656c68756265722f636f64656d6370)](https://github.com/vielhuber/codemcp/tags)[![Code Style](https://camo.githubusercontent.com/1540f8ce219727155ab62506c77b818b720421c22c4cf0b18a5f160942132e2d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64655f7374796c652d7073722d2d31322d6666363962342e737667)](https://www.php-fig.org/psr/psr-12/)[![License](https://camo.githubusercontent.com/061061fcfa1073217e3e871bce4d3b8d4633ec1ebd0435caf16cc446fe2f39cf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7669656c68756265722f636f64656d6370)](https://github.com/vielhuber/codemcp/blob/main/LICENSE.md)[![Last Commit](https://camo.githubusercontent.com/8f0ee279295fcf2c15bb9ffe71cfbf1a9c3b796dff3ea42ee80c01e4460e856a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f7669656c68756265722f636f64656d6370)](https://github.com/vielhuber/codemcp/commits)[![PHP Version Support](https://camo.githubusercontent.com/c52ba5a58f89d2bbb53f118815ef4de45cf5a34337191c58b3620ab9d6300b35/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7669656c68756265722f636f64656d6370)](https://packagist.org/packages/vielhuber/codemcp)[![Packagist Downloads](https://camo.githubusercontent.com/ec5053b240a01f465485159c6daef0178a27fd4ea5c7b1ff5c19da9ddd00f36a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7669656c68756265722f636f64656d6370)](https://packagist.org/packages/vielhuber/codemcp)

📟 codemcp 📟
===========

[](#-codemcp-)

codemcp exposes agentic coding through the official harnesses of **Codex** and **Claude Code** as a small mcp server. runs are **asynchronous**: they execute detached, results are collected by polling — safe behind any transport timeout.

installation
------------

[](#installation)

```
composer require vielhuber/codemcp
```

setup
-----

[](#setup)

`.env` in the project root (only for mcps via `http`):

```
MCP_TOKEN=
```

usage
-----

[](#usage)

every function below is also exposed 1:1 as an mcp tool of the same name.

```
$code = codemcp::create();

$session = $code->start(
    prompt: 'Fix the failing tests.',
    workdir: '/app',
    provider: 'claude',
    model: 'claude-opus-4-8',
    effort: 'high'
);

$session = $code->wait(
    session_id: $session['session_id'],
    timeout: 120
);

$session = $code->status(
    session_id: $session['session_id']
);
$code->status();

$session = $code->continue(
    session_id: $session['session_id'],
    prompt: 'Now also fix the linter warnings.'
);

$session = $code->stop(
    session_id: $session['session_id']
);

$providers = $code->providers();
```

When `workdir` is omitted, each new session gets a random isolated directory under `sys_get_temp_dir()/codemcp/`. An explicit directory is created recursively when it does not exist, so new projects start in their final workspace and retain folder continuity. A running session for that folder is reused; otherwise Codemcp resumes the most recently active native Codex or Claude session and creates a new thread only when no folder history exists. `model` and `effort` are optional; when omitted, the selected coding agent uses its own defaults. Supported explicit effort values are `minimal`, `low`, `medium`, `high` and `xhigh`.

When `start` or `continue` submits a prompt to an existing session, the immediate response has status `queued`. `queued_prompt` and `queue_position` describe the new submission, while `previous_prompt` and `previous_result` expose the prior context without presenting it as the new result. `session_status` contains the underlying runtime state. Subsequent `wait` and `status` calls return the regular session status (`running`, `completed`, `error` or `stopped`) and the new final answer in `last_content`.

Long-running agents are limited by inactivity, not total runtime. MCP progress events and command output reset the internal inactivity timeout, so an active run can continue beyond 30 minutes while a stalled run is still terminated.

tests
-----

[](#tests)

```
./vendor/bin/phpunit
```

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance98

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

20

Last Release

14d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3183737?v=4)[David Vielhuber](/maintainers/vielhuber)[@vielhuber](https://github.com/vielhuber)

---

Top Contributors

[![vielhuber](https://avatars.githubusercontent.com/u/3183737?v=4)](https://github.com/vielhuber "vielhuber (23 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/vielhuber-codemcp/health.svg)

```
[![Health](https://phpackages.com/badges/vielhuber-codemcp/health.svg)](https://phpackages.com/packages/vielhuber-codemcp)
```

###  Alternatives

[ashallendesign/laravel-executor

Configurable code that can be ran when installing or updating your web app.

2553.0k](/packages/ashallendesign-laravel-executor)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
