FA

faezs/agda-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

12 stars 7 forks 品質 55 トレンド 12

インタラクティブなAgda開発機能を提供するモデルコンテキストプロトコル(MCP)サーバー。 これにより、AIによる実証開発、インタラクティブな理論の検証、およびアグダコードの探査が可能になります.

概要

インタラクティブなAgda開発機能を提供するモデルコンテキストプロトコル(MCP)サーバー。 これにより、標準化されたプロトコルを介して、AgdaコードのAIによる実証済みの開発、インタラクティブな理論の検証、および探索が可能になります。 - : コマンド間でAgdaインタラクションの状態を維持し、目標、コンテキスト、および型チェック結果を保存します - : 証拠検索、ケース分割、モジュール探索を含むAgdaインタラクション操作の包括的なカバレッジ - : コード(give、 refine、case Split、auto)を自動変更するコマンド - : HTTP/JSON-RPCトランスポート付きのStandards-compliant MCPサーバー - : 堅牢なMCPプロトコルのシステムで構築されたMCPプロトコルのコンプリート、JSON-S-Stretchモードを手動で変更します。 サーバは、バックグラウンドスレッドで永続的な Agda REPL を実行します。, チャンネルを介して通信: - コマンドは、Chan CommandWithResponse を介して送信されます。 - 応答は、MVar Response を介してルーティングされます - 各 MCP ツール...

概要(AI 翻訳)

インタラクティブなAgda開発機能を提供するモデルコンテキストプロトコル(MCP)サーバー。 これにより、標準化されたプロトコルを介して、AgdaコードのAIによる実証済みの開発、インタラクティブな理論の検証、および探索が可能になります。

##特徴

  • 永続性REPLセッション:目標、コンテキスト、およびタイプチェック結果を保存し、コマンド間でAgdaインタラクション状態を維持
  • 24 インタラクティブコマンド: 証拠検索、ケース分割、モジュール探査を含むアグダの相互作用操作の包括的なカバレッジ
  • 自動ファイル永続:コード(give, refine, case split, auto)を変更するコマンドは、自動的にディスクへの変更を主張します
  • ** HTTP 輸送**: HTTP/JSON-RPC トランスポートで標準準拠の MCP サーバー
  • タイプ安全統合: 堅牢なMCPプロトコル処理用の Haskell の型システムで構築
  • スマートな応答の書式:任意完全なJSONモードとのデフォルト(~90%のサイズの減少)による人間読みやすい出力を簡潔にして下さい

アーキテクチャ

サーバは、バックグラウンドスレッドで永続的な Agda REPL を実行します。, チャネルを介して通信:

  • コマンドは [Chan CommandWithResponse で送信されます。
  • 応答は[[MVar Response]を介してルーティングされます

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

Agda MCP Server

A Model Context Protocol (MCP) server that provides interactive Agda development capabilities. This enables AI-assisted proof development, interactive theorem proving, and exploration of Agda code through a standardized protocol.

Features

  • Persistent REPL Session: Maintains Agda interaction state across commands, preserving goals, context, and type-checking results
  • 24 Interactive Commands: Comprehensive coverage of Agda interaction operations including proof search, case splitting, and module exploration
  • Automatic File Persistence: Commands that modify code (give, refine, case split, auto) automatically persist changes to disk
  • HTTP Transport: Standards-compliant MCP server with HTTP/JSON-RPC transport
  • Type-Safe Integration: Built with Haskell’s type system for robust MCP protocol handling
  • Smart Response Formatting: Concise human-readable output by default (~90% size reduction), with optional full JSON mode

Architecture

The server runs a persistent Agda REPL in a background thread, communicating via channels:

  • Commands are sent through a Chan CommandWithResponse
  • Responses are routed back via MVar Response
  • Each MCP tool call is converted to an IOTCM command and executed in the persistent REPL
  • Goals, context, and interaction state persist between commands

File Edit Persistence

When commands modify Agda code, changes are automatically persisted to disk:

  • Response capture: The REPL callback intercepts typed Response values (e.g., Resp_GiveAction, Resp_MakeCase)
  • Monadic: Edit operations are in the TCM monad context using Agda’s native APIs
  • Type-specific strategies: Different edit types for different operations:
    • ReplaceHole: In-place hole filling (give, refine, auto)
    • ReplaceLine: Structural edits with line insertion (case split)
    • BatchEdits: Multiple operations applied in reverse position order (auto_all)
  • Position-aware: Edits preserve file structure and handle position invalidation correctly

This architecture ensures that operations like “load file” → “get goals” → “give solution” not only update the REPL state but also persist the changes to the source file.

Prerequisites

  • Nix with flakes enabled
  • Agda (automatically provided by Nix environment)
  • Claude Code or another MCP client

Installation

  1. Clone the repository:
git clone https://github.com/faezs/agda-mcp.git
cd agda-mcp
  1. Enter the Nix development shell:
nix develop
  1. Build the server:
cabal build
  1. Run the server:
cabal run agda-mcp

The server starts on http://localhost:3000/mcp by default.

Configuration

Claude Code

Add to your Claude Code MCP configuration file (~/.config/claude-code/mcp.json):

{
  "mcpServers": {
GitHub で README 全文を見る

インストール

This server does not publish a one-line install command.

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "agda-mcp": { "transport": "http", "url": "http://localhost:3000/mcp", "command": "cabal", "args": ["run", "agda-mcp"], "cwd": "/path/to/agda-mcp" } } }