
faezs/agda-mcp
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
インタラクティブな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
IOTCMcommand 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
Responsevalues (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
- Clone the repository:
git clone https://github.com/faezs/agda-mcp.git
cd agda-mcp
- Enter the Nix development shell:
nix develop
- Build the server:
cabal build
- 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": {
インストール
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"
}
}
}