hideyukimori / nene-mcp
Standalone PHP stdio MCP server for NeNe / NENE2-style OpenAPI tool catalogs
Requires
- php: ^8.2
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
Suggests
- hideyukimori/nene: Reference template when combining OpenAPI with NeNe
- hideyukimori/nene2: Ship tool catalogs matching NENE2 docs/mcp/tools.json format
- dev-main
- v0.1.8
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- dev-feat/112-ft750-779-l18-band
- dev-feat/110-ft720-749-l17-band
- dev-feat/108-ft690-719-l16-band
- dev-feat/106-ft660-689-l15-band
- dev-feat/104-ft630-659-l14-band
- dev-feat/95-ft510-539-l10-band
- dev-feat/101-ft600-629-l13-band
- dev-feat/99-ft570-599-l12-band
- dev-feat/97-ft540-569-l11-band
- dev-feat/89-smb-adoption-tier
- dev-docs/87-commercial-use-scope
- dev-fix/85-quality-review
- dev-chore/83-l9-ft480-509
- dev-chore/81-l8-ft450-479
- dev-chore/79-l7-ft420-449
- dev-docs/77-ft380-419
- dev-release/v0.1.6
- dev-docs/73-ft339-378
- dev-docs/71-f7-safety-mislabel
- dev-docs/69-ft296-336-post-015
- dev-release/v0.1.5
- dev-fix/65-ft255-294-adversarial
- dev-docs/62-ft225-254-regression-band
- dev-docs/60-ft224-post-release-smoke
- dev-release/v0.1.4
- dev-chore/ft222-changelog-index
- dev-docs/ft221-i18n-catalog-query
- dev-docs/54-test-integration-ft219-220
- dev-docs/ft218-index-readme
- dev-docs/51-csrf-query-ft215-217
- dev-docs/index-214-row
- dev-docs/ft214-todo-update
- dev-docs/ft213-i18n-cursor-tips
- dev-docs/46-cursor-relative-cwd
- dev-docs/fix-index-ft211
- dev-docs/ft210-211-regression-index
- dev-docs/41-pt-br-locale-ft209
- dev-docs/40-de-locale-ft208
- dev-docs/38-bearer-native-ft206-207
- dev-docs/36-nene-auth-path-uri
- dev-fix/34-ja-docs-parity
- dev-fix/31-packagist-verify
- dev-fix/31-ft202-doc
- dev-fix/29-ft201-persona-docs
- dev-docs/27-vitepress-i18n
- dev-feat/25-ft10-200
- dev-fix/22-duplicate-names-ft9-quality
- dev-feat/22-ft5-100-automation
- dev-docs/21-ft4-catalog-free
- dev-fix/19-ft3-disable-redirects
- dev-docs/16-packagist-live
This package is auto-updated.
Last update: 2026-05-22 16:17:05 UTC
README
nene-mcp
A small PHP library that adds stdio MCP (Model Context Protocol) to NeNe apps with a single composer require—no NeNe fork, no MCP code in framework core.
Developers familiar with legacy PHP can run it with Composer and environment variables only. It works standalone without importing NeNe or NENE2 source. Any HTTP API—Laravel, vanilla PHP, Node, etc.—can use the same bridge when you provide a NENE2-compatible docs/mcp/tools.json.
Learn more: Documentation site · docs/project.md · NeNe integration
Features
- Standalone: built-in read-only tool
nene_mcp_aboutout of the box. - NENE2-compatible wire: newline-delimited JSON-RPC with
initialize/tools/list/tools/call. - Committed catalog JSON (optional) adds OpenAPI-aligned tool entries.
- Security defaults: write fail-closed, no redirect following, catalog validation (
safety: read|write). - SMB / staging operators (v0.1.8+): configurable HTTP timeout, optional TLS CA bundle, opt-in stderr HTTP log — see SMB adoption checklist.
- Shared Issue-driven workflow + Conventional Commits with NeNe and NENE2.
Scope: MCP sidecar for developers and small teams (Cursor, Claude Desktop, internal staging)—not a customer-facing API gateway. See Commercial use & scope.
Install
composer require hideyukimori/nene-mcp
Published on Packagist. Pin for reproducible deploys:
composer require hideyukimori/nene-mcp:0.1.8
Or clone for development:
git clone git@github.com:hideyukiMORI/nene-mcp.git cd nene-mcp composer install composer test
Cursor / MCP client example (local NeNe app)
Set the absolute path to vendor/bin/nene-mcp and env vars for your environment.
With tool catalog (typical)
{
"mcpServers": {
"nene-mcp": {
"command": "php",
"args": ["/ABS/PATH/vendor/bin/nene-mcp"],
"env": {
"NENE_MCP_API_BASE_URL": "http://localhost:8080",
"NENE_MCP_TOOLS_JSON": "/ABS/PATH/ne-app/docs/mcp/tools.json"
}
}
}
}
Catalog-free (smoke test / Day 0)
Omit NENE_MCP_TOOLS_JSON until tools.json exists. MCP starts with only nene_mcp_about:
{
"mcpServers": {
"nene-mcp": {
"command": "php",
"args": ["/ABS/PATH/vendor/bin/nene-mcp"],
"env": {
"NENE_MCP_API_BASE_URL": "http://localhost:8080"
}
}
}
}
Do not set NENE_MCP_TOOLS_JSON to a placeholder path—a missing file fails tools/list entirely.
Without a catalog, MCP still starts and tools/list exposes only nene_mcp_about. See docs/example-ne-health-catalog.md for a minimal NeNe sample when you add HTTP tools.
Environment variables
| Variable | Meaning |
|---|---|
NENE_MCP_API_BASE_URL |
REST base URL (no trailing slash). Default http://localhost:8080. Overridable via NENE2_LOCAL_API_BASE_URL. |
NENE_MCP_TOOLS_JSON |
Path to NENE2-compatible tool catalog JSON. When omitted, no OpenAPI HTTP tools—only nene_mcp_about. Also accepts NENE2_LOCAL_TOOLS_JSON. |
NENE_MCP_BEARER_TOKEN |
For endpoints that require Bearer (e.g. safety: write). Keep secrets in env only. |
Optional (SMB / staging — v0.1.8+):
| Variable | Meaning |
|---|---|
NENE_MCP_HTTP_TIMEOUT_SEC |
HTTP timeout seconds (1–120, default 10) |
NENE_MCP_TLS_CA_FILE |
PEM CA bundle path for https:// base URLs |
NENE_MCP_LOG |
Set to stderr for safe per-request HTTP lines (never stdout) |
Full reference: Environment variables.
Composer scripts
composer test # PHPUnit composer check # PHPUnit + PHPStan level 8
Documentation
| Document | Contents |
|---|---|
| docs/project.md | Purpose, NeNe relationship, architecture |
| docs/integration/nene.md | Composer integration for NeNe |
| docs/integration/other-platforms.md | Other frameworks, vanilla PHP, other languages |
| docs/README.md | Documentation index |
| AGENTS.md | Guide for AI agents |
Contributing
Governance follows NENE2-style strict policy—read before opening a PR:
docs/workflow.md— Issue and branch policydocs/development/coding-standards.md— PHP / MCP rulesdocs/development/security-policy.md— security requirementsdocs/review/mcp-server.md— pre-PR checklist for code changesdocs/field-trials/README.md— field trial methodologydocs/development/release-policy.md— versioning and Packagist timingdocs/CONTRIBUTING.md— full contribution guide
License
MIT — see LICENSE.