# AFSIM MCP

> MCP (Model Context Protocol) server for AFSIM simulation framework. Provides natural language scenario generation, entity management, simulation control, and result analysis. Enables LLMs to interact with AFSIM through standardized tools.

- **Type:** MCP server
- **Install:** `agentstack add mcp-yookio-z-afsim-mcp`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Yookio-Z](https://agentstack.voostack.com/s/yookio-z)
- **Installs:** 0
- **Category:** [Integrations](https://agentstack.voostack.com/c/integrations)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Yookio-Z](https://github.com/Yookio-Z)
- **Source:** https://github.com/Yookio-Z/AFSIM_MCP

## Install

```sh
agentstack add mcp-yookio-z-afsim-mcp
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# AFSIM MCP Server

MCP (Model Context Protocol) server for the **Advanced Framework for Simulation, Integration, and Modeling (AFSIM)**. Enables LLMs and AI agents to interact with AFSIM through standardized tools.

## Features

| Category | Tools |
|---|---|
| **Scenario Management** | `create_scenario`, `load_scenario`, `save_scenario`, `validate_scenario`, `list_scenarios`, `delete_scenario`, `get_scenario_content`, `list_scenario_files` |
| **Entity & Component Management** | `create_platform`, `delete_platform`, `modify_platform`, `list_platforms`, `add_mover`, `add_sensor`, `add_weapon`, `remove_component`, `list_components` |
| **Simulation Control** | `run_simulation`, `stop_simulation`, `get_simulation_status`, `list_simulation_runs`, `set_afsim_binary` |
| **Results Handling** | `list_result_files`, `query_csv_results`, `query_evt_results`, `query_aer_results`, `export_results_to_json`, `get_results_summary` |
| **AFSIM Backend** | `set_afsim_home`, `detect_afsim_installation`, `set_tool_binary_path`, `run_wizard`, `run_mission`, `run_warlock`, `run_mystic` |
| **Natural Language** | `generate_scenario_from_prompt`, `refine_scenario_from_prompt` |

## Installation

```bash
pip install -e .
```

Or install dependencies directly:

```bash
pip install mcp
```

## Usage

### Running the server

```bash
# Via installed CLI
afsim-mcp

# Via Python module
python -m afsim_mcp.server
```

The server uses **stdio transport** and is compatible with any MCP client (Claude Desktop, VS Code MCP extension, etc.).

### Claude Desktop configuration

Add to `claude_desktop_config.json`:
=======
# AFSIM MCP

本项目是一个本地 MCP 服务器，用于把 AFSIM 能力接入支持 MCP 的客户端（如 Cursor、Claude Desktop、VS Code、Trae、OpenCode 等）。

仓库只包含 MCP 服务源码与配置脚本，不附带测试工程、测试数据、示例生成产物或本地运行状态。实际使用时，请把 AFSIM 工程目录通过配置指向你自己的 `project_root`。

如需给大模型或团队成员提供统一项目背景与建模建议，可参考仓库中的 `memory.md`。
如需评估当前项目真实能力边界，可参考 `CAPABILITY_ASSESSMENT.md`；如需约束接入大模型的标准工作流，可参考 `MODEL_WORKFLOW_PROMPT.md`。

## 前置条件

- Windows
- Python 3.10+
- 已安装 AFSIM（本机可运行）

## 快速开始

在项目目录执行：

```bash
python configure_mcp.py
```

脚本会按提示询问并写入本地配置，同时输出客户端所需的 MCP 配置片段。

### 配置项说明

- AFSIM 根目录：AFSIM 安装目录
- AFSIM 项目目录：你的 AFSIM 工程目录
- AFSIM demos 目录：官方示例目录
- AFSIM bin 目录：`mission.exe` 等可执行文件所在目录
- 配置文件存放目录：默认 `C:\Users\你的用户名\.afsim_mcp`
- 运行时状态目录：默认 `project_root\mcp_state`；客户端通常只需要传入 `AFSIM_MCP_CONFIG_DIR` 用于定位配置文件，如需覆盖状态目录可额外设置 `AFSIM_MCP_STATE_DIR`

如果检测到已有配置，脚本会显示旧值；直接回车表示保留旧值。

## 客户端配置

脚本会输出两段内容：

1) 通用连接信息  
2) 你选择的平台对应的 JSON 配置示例

```json
{
  "mcpServers": {
    "afsim": {
      "command": "afsim-mcp"
    }
  }
}
```

Or if not installed:

```json
{
  "mcpServers": {
    "afsim": {
      "command": "python",
      "args": ["-m", "afsim_mcp.server"],
      "cwd": "/path/to/AFSIM_MCP"
    }
  }
}
```

## Source & license

This open-source MCP server is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Yookio-Z](https://github.com/Yookio-Z)
- **Source:** [Yookio-Z/AFSIM_MCP](https://github.com/Yookio-Z/AFSIM_MCP)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/mcp-yookio-z-afsim-mcp
- Seller: https://agentstack.voostack.com/s/yookio-z
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
