Logo Stk MCP

Stk MCP

Cộng đồng
alti3

An MCP server allowing LLMs to interact with Ansys/AGI STK - Digital Mission Engineering Software

Nhà phát hànhalti3
Kho mãstk-mcp
Ngôn ngữPython
Bản fork
10
Sao
42
Công cụ có sẵn
0
Phương thức truyền tảistdio
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    Stk MCP cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    42 sao và 10 bản fork từ kho mã được liên kết.

STK-MCP

Python Version MCP Version

STK-MCP is an MCP (Model Context Protocol) server designed to enable Large Language Models (LLMs) or other MCP clients to interact with Ansys/AGI STK (Systems Tool Kit) - the leading Digital Mission Engineering software.

This project allows controlling STK via an MCP server, supporting both STK Desktop (Windows only) and STK Engine (Windows & Linux). It utilizes FastMCP from the official MCP Python SDK.

Overview

The primary goal of this project is to bridge the gap between programmatic interaction and the powerful simulation capabilities of STK. By exposing STK functionalities through a robust CLI and an MCP server, users can command STK simulations using simple commands or LLM-driven applications.

The MCP application, defined in src/stk_mcp/app.py, exposes STK operations as MCP tools, which are dynamically managed by a CLI entry point in src/stk_mcp/cli.py.

Features

  • CLI entry point powered by Typer.
  • Dual mode operation: STK Engine (Windows/Linux) and STK Desktop (Windows).
  • OS-aware: Desktop mode auto-disabled on non-Windows platforms.
  • Managed lifecycle: STK instance is started/stopped with the MCP server.
  • Tool discovery: list-tools command enumerates available MCP tools.
  • Modular architecture: CLI (cli.py), MCP (app.py), STK logic (stk_logic/), and MCP tools (tools/).

Prerequisites

  • Operating System: Windows or Linux. STK Desktop mode requires Windows.
  • Python: Version 3.12 or higher.
  • Ansys/AGI STK: Version 12.x Desktop or Engine installed.
  • STK Python API: The agi.stk12 Python wheel corresponding to your STK installation must be available. Typically found under CodeSamples\Automation\Python in your STK install.

Installation

  1. Clone the repository
    bash
    git clone <repository-url>
    cd stk-mcp
  2. Create and activate a virtual environment
    bash
    # Create the virtual environment
    uv venv
    
    # Activate it
    # On Windows (in PowerShell/CMD):
    # .venv\Scripts\activate
    # On Linux (in bash/zsh):
    source .venv/bin/activate
  3. Add dependencies with uv (preferred)
    • Add the STK Python wheel from your STK installation (local file):
    bash
    uv add ./agi.stk12-12.10.0-py3-none-any.whl
    # or: uv add path/to/your/STK/CodeSamples/Automation/Python/agi.stk12-*.whl
  4. Sync the environment (installs deps from pyproject.toml)
    bash
    uv sync

Usage

This project is a command-line application. Ensure your virtual environment is activated before running commands.

Listing Available Tools

bash
uv run -m stk_mcp.cli list-tools

Prints a table of tool names and their descriptions.

Running the MCP Server

Use the run command to start the MCP server. The server will automatically start and manage an STK instance.

Run with uv run so you don’t need to install the package into site-packages.

1) STK Engine (recommended for automation, Windows/Linux):

bash
uv run -m stk_mcp.cli run --mode engine

2) STK Desktop (Windows only, shows GUI): Ensure STK Desktop is closed; the server will launch and manage its own instance.

bash
uv run -m stk_mcp.cli run --mode desktop

The server will start, initialize STK, and listen for MCP connections on http://127.0.0.1:8765 by default.

3. Command Options: You can see all options with the --help flag:

bash
stk-mcp run --help

Interacting with the Server

Once the server is running, you can connect to it using any MCP client, such as the MCP Inspector.

  1. Open the MCP Inspector URL provided in the console (e.g., http://127.0.0.1:8765).
  2. Find the "STK Control" server in the list.
  3. Use the "Tools" section to execute setup_scenario, create_location, and create_satellite.

Stopping the Server

Press Ctrl+C in the terminal where the server is running. The lifecycle manager will automatically close the STK Engine or Desktop instance.

MCP Tools and Resources

The server exposes the following MCP tools/resources.

NameKindDescriptionDesktop (Windows)Engine (Windows)Engine (Linux)
setup_scenarioToolCreate/configure an STK Scenario; sets time period and rewinds animation.YesYesYes
create_locationToolCreate/update a Facility (default) or Place at latitude/longitude/altitude (km).YesYesYes
create_satelliteToolCreate/configure a satellite from apogee/perigee (km), RAAN, and inclination; TwoBody prop.YesYesNo

Resources:

NameKindDescriptionDesktop (Windows)Engine (Windows)Engine (Linux)
resource://stk/objectsResourceList all objects in the active scenario. Returns JSON records: {name, type}.YesYesYes
resource://stk/objects/{type}ResourceList objects filtered by type (e.g., satellite, facility, place, sensor). Returns JSON records.YesYesYes
resource://stk/healthResourceReport basic state: mode, scenario name, and object counts.YesYesYes
resource://stk/analysis/access/{object1}/{object2}ResourceCompute access intervals between two objects. Provide paths like Satellite/SatA and Facility/FacB (with or without leading */).YesYesYes
resource://stk/reports/lla/{satellite}ResourceReturn satellite LLA ephemeris over the scenario start/stop interval. Provide path like Satellite/SatA (with or without leading */).YesYesYes

Examples:

  • Read all objects: resource://stk/objects
  • Read only satellites: resource://stk/objects/satellite
  • Read ground locations: resource://stk/objects/location (alias for facilities and places)

Access and LLA examples:

  • Compute access: resource://stk/analysis/access/Satellite/ISS/Facility/Boulder
  • Get ISS LLA (60 s): resource://stk/reports/lla/Satellite/ISS (optional step_sec argument)

Configuration & Logging

Configuration is centralized in src/stk_mcp/stk_logic/config.py using pydantic-settings. Defaults can be overridden with environment variables (prefix STK_MCP_).

  • STK_MCP_DEFAULT_HOST (default 127.0.0.1)
  • STK_MCP_DEFAULT_PORT (default 8765)
  • STK_MCP_LOG_LEVEL (default INFO)
  • STK_MCP_DEFAULT_SCENARIO_NAME (default MCP_STK_Scenario)
  • STK_MCP_DEFAULT_START_TIME (default 20 Jan 2020 17:00:00.000)
  • STK_MCP_DEFAULT_DURATION_HOURS (default 48.0)

Logging is standardized via src/stk_mcp/stk_logic/logging_config.py. The CLI uses this configuration, producing structured logs with timestamps, levels, and context.

Implementation Notes

  • STK access is serialized with a global lock to avoid concurrency issues.
  • Common STK-availability checks are handled via decorators in src/stk_mcp/stk_logic/decorators.py (@require_stk_tool and @require_stk_resource).
  • STK Connect commands that may be transiently flaky are executed with retry logic (tenacity) in src/stk_mcp/stk_logic/utils.py (safe_stk_command).
  • Long-running internal operations are timed with @timed_operation for diagnostics.

Dependencies

Managed with uv:

  • agi.stk12 (local wheel from your STK install)
  • mcp[cli]>=1.6.0
  • uvicorn>=0.30 (explicit for CLI server)
  • rich>=13.7 (CLI table output)
  • typer>=0.15.2
  • pydantic>=2.11.7

Notes:

  • On macOS (Darwin), STK Engine/Desktop are not supported. The server will start but STK-dependent tools/resources are unavailable.
  • The server serializes STK access via a global lock to avoid concurrency issues with multi-threaded access to the STK Engine/Desktop instance.

Contributing

Contributions are welcome! Please see the CONTRIBUTING.md file for guidelines.

Dùng MCP Stk MCP với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối Stk MCP, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm Stk MCP làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của Stk MCP.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "stk-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của Stk MCP, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của Stk MCP.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng Stk MCP giúp tôi làm việc này không?
Stk MCP
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng Stk MCP.

Câu hỏi thường gặp

Máy chủ MCP Stk MCP dùng để làm gì?

Stk MCP là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP Stk MCP với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng Stk MCP với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP Stk MCP với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối Stk MCP, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP Stk MCP với TypingMind?

Stk MCP hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP Stk MCP cung cấp những công cụ nào trong TypingMind?

Stk MCP cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP Stk MCP không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu Stk MCP yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇