Metadata-Version: 2.3
Name: ddd23331-afsim-optimization-mcp
Version: 0.1.1
Summary: Governed AFSIM planning Tools exposed through FastAPI and MCP.
Author: ddd23331
Author-email: ddd23331 <ddd23331@users.noreply.github.com>
Requires-Dist: fastapi>=0.115,<1.0
Requires-Dist: graphiti-core==0.29.3
Requires-Dist: mcp>=1.29.1,<2.0
Requires-Dist: neo4j==5.28.4
Requires-Dist: pydantic>=2.9,<3.0
Requires-Dist: uvicorn[standard]>=0.30,<1.0
Requires-Dist: httpx>=0.27,<1.0 ; extra == 'test'
Requires-Dist: pytest>=8.3,<9.0 ; extra == 'test'
Requires-Python: >=3.12
Provides-Extra: test
Description-Content-Type: text/markdown

# ddd23331-afsim-optimization-mcp

`ddd23331-afsim-optimization-mcp` packages the governed AFSIM planning Tool suite for Python, FastAPI,
and MCP clients. It exposes the same eight domain Tools through a Streamable
HTTP MCP server, an SSE MCP server for local development, and a FastAPI OpenAPI
surface for Dify.

## Install

```bash
pip install ddd23331-afsim-optimization-mcp
```

For development and package tests:

```bash
pip install "ddd23331-afsim-optimization-mcp[test]"
```

## Run an MCP server

The default command starts local SSE transport on `127.0.0.1:8001`.

```bash
ddd23331-afsim-optimization-mcp
```

For remote Streamable HTTP MCP:

```bash
MCP_TRANSPORT=streamable_http MCP_BIND_HOST=127.0.0.1 MCP_PORT=8001 ddd23331-afsim-optimization-mcp
```

Set `MCP_STAGING_API_KEY` to require `Authorization: Bearer <key>`. The default
scope is the read-only `scenario.read`; expand `MCP_ALLOWED_SCOPES` only after
controlled staging validation.

## FastAPI / Dify

Run the OpenAPI service with:

```bash
uvicorn mcpdemo.main:app --host 127.0.0.1 --port 8000
```

For Dify, import `/openapi/domain-tools.json`. It deliberately publishes only
the eight registered domain Tools and excludes legacy compatibility and
knowledge routes. Configure `ADAPTER_STAGING_API_KEY` as a Bearer credential.

## Included Tool IDs

`scenario_context`, `validate_object`, `evaluate_coa_quality`,
`evaluate_effectiveness`, `build_task_timeline`,
`validate_resources_and_state`, `render_oplan_artifacts`, and
`afsim_execution`.

The bundled runner uses deterministic development fixtures. Its
`afsim_execution` output is explicitly marked `runner_mode=SIMULATED`; it is
not real AFSIM execution evidence.

## ModelScope Hosted MCP

ModelScope managed deployment launches this package over stdio. After this
package has been published to PyPI, use the following Server config in the
repository root README or in ModelScope custom creation:

```json
{
  "command": "uvx",
  "args": ["ddd23331-afsim-optimization-mcp"],
  "env": {
    "MCP_TRANSPORT": "stdio",
    "MCP_ALLOWED_SCOPES": "scenario.read"
  }
}
```

The stdio transport is intended for managed MCP runtimes. Use
`MCP_TRANSPORT=streamable_http` with an HTTP server only when a remote `/mcp`
endpoint is required.
