modwire

modwire

Provides a tool to inspect and execute actions on a scaffolding API through Siren hypermedia links, enabling management of scaffolding resources without endpoint knowledge.

Category
访问服务器

README

modwire-agent

Django API scaffold with JSON logs, dotenv settings, health checks, and auto-discovered Django Ninja Extra controllers.

uv sync
uv run python manage.py migrate
uv run python manage.py runserver

Isolated scaffolding API

The container runtime reuses the existing PostgreSQL state; it does not create or own a database service or volume. It reuses the host DATABASE_URL already in the ignored .env file. Compose overrides only its network address to postgres:5432 because the API joins the external modwire-records_default Docker network. The host configuration remains on localhost:5433; credentials have one source of truth.

Released runtime images are pulled from GHCR. The default is latest; pin both services to one immutable release with MODWIRE_MCP_VERSION, for example:

MODWIRE_MCP_VERSION=0.2.1 make mcp-up

The packages are private. Authenticate GitHub CLI once with read:packages; runtime commands then use its token through a temporary Docker configuration that is deleted immediately after the pull:

gh auth refresh -h github.com -s read:packages

Each GitHub release publishes linux/amd64 and linux/arm64 variants of ghcr.io/modwire/modwire-agent-runtime and ghcr.io/modwire/modwire-agent-adapter. Docker selects the matching image on Intel Linux, Intel macOS, or Apple Silicon macOS hosts. Local image builds are an explicit development mode and never occur during normal installation:

make runtime-build-up
make mcp-build-up

Validate and start only the API:

make runtime-config
make runtime-up
curl --fail http://127.0.0.1:8100/health/

Container startup never applies migrations. Before a migration, create a PostgreSQL backup and capture the exact Django migration plan:

make runtime-db-prepare

Review both paths printed by that command. Apply the reviewed plan only by passing those same artifacts through the guarded command:

CONFIRM_EXISTING_DATABASE_MIGRATION=reviewed \
MODWIRE_DATABASE_BACKUP=.dev/database-safety/modwire-records-TIMESTAMP.dump \
MODWIRE_DATABASE_MIGRATION_PLAN=.dev/database-safety/migration-plan-TIMESTAMP.txt \
make runtime-db-migrate

make runtime-down removes the API container only. The external PostgreSQL container, network, and modwire-records_postgres_data volume are untouched.

For non-container development, keep using the host DATABASE_URL (currently the host-side PostgreSQL port) with the original uv run commands above. Its default HTTP port remains 8000, separate from the container runtime on 8100.

MCP scaffolding adapter

The deterministic aggregate convergence contract and operational package adoption deltas are documented in docs/scaffolding-convergence.md.

The MCP adapter is a separate stateless service. It discovers the scaffolding collection from the Siren API root and executes only actions advertised by the canonical scaffold resource. It does not import Django or Modwire CLI modules, mount a workspace, connect to PostgreSQL, or construct scaffolding routes. Its image uses a separate dependency group and contains neither the Django application nor its database dependencies.

Place a dedicated API key in the ignored file configured by MCP_ADAPTER_API_KEY_FILE (the default is .dev/secrets/mcp-adapter-api-key), then start both isolated services:

make mcp-up
make mcp-health
make mcp-check

The Streamable HTTP endpoint is http://127.0.0.1:8200/mcp. The health endpoint reports the adapter version, API reachability, and the number of relations and actions advertised at the Siren root without returning the API key. The adapter exposes one stable tool, modwire, with two operations:

  • inspect follows a path of advertised Siren relations and collection items;
  • execute follows the same kind of path and submits values to an action advertised by the selected resource.

For example, inspect the scaffolding collection with:

{
  "request": {
    "kind": "inspect",
    "path": [{"kind": "relation", "relation": "scaffoldings"}]
  }
}

The returned Siren document supplies item identities, links, actions, and runtime field schemas. Clients inspect those controls before choosing the next step. Adding an API capability therefore does not alter the MCP tool catalog or require another MCP client restart or tool-schema discovery cycle.

The services Docker network is internal. mcp-adapter uses it to reach the API and joins a separate edge bridge for its loopback-published MCP port. scaffolding-api alone bridges the internal service network to the external PostgreSQL network, so the adapter has no database route.

Install for Codex

Run the host installer from this checkout:

make mcp-install

The installer verifies GitHub package access plus the existing PostgreSQL container and network, securely pulls and starts the released runtime images, creates a dedicated API key only when the ignored local secret is missing or invalid, runs the complete MCP smoke workflow, and registers one global Codex entry named modwire at http://127.0.0.1:8200/mcp. The key value is redirected directly into a mode-600 ignored file and is not printed. Re-running the installer preserves the same API identity while the secret remains valid.

Codex loads MCP configuration when a session starts. Open a new session once after installing this one-tool adapter; subsequent API capability additions are discovered through Siren without another session restart. Diagnose each runtime layer independently with:

make mcp-diagnose

Uninstall only the Codex entry and these runtime containers with:

make mcp-uninstall

Uninstall never passes Docker's --volumes option. It preserves modwire-records-postgres-1, modwire-records_default, modwire-records_postgres_data, all scaffolding records, and the dedicated API identity for a later reinstall.

Future CLI runner

Workspace mutation is intentionally absent from this installation. A future optional cli-runner profile will package modwire-cli separately and mount only an explicitly selected workspace. The MCP adapter will call that capability through its contract; it will not import CLI internals or gain a workspace mount itself. Scaffolding discovery, bundles, and previews do not depend on the CLI runner.

Hypermedia API browser

The authenticated API entry point is GET /api/. Successful API responses use the Siren media type (application/vnd.siren+json) and advertise the links and actions that are valid for the current resource. Clients can start with one URL and traverse relations instead of constructing endpoint URLs:

curl -H "apikey: $MODWIRE_API_KEY" -H "Accept: application/vnd.siren+json" http://localhost:8000/api/

Build the React browser and then open http://localhost:8000/browser/:

cd browser
npm install
npm run build
cd ..
uv run python manage.py runserver

For frontend development, run Django on port 8000 and npm run dev in browser/; Vite proxies /api to Django. The browser prompts for an API key and stores it only in the current tab's sessionStorage.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选