mcpField
@
@obiwan90/edgedb-mcp-server

@obiwan90/edgedb-mcp-server

ローカル
github.com/obiwan90データベース078 週間前に更新

@obiwan90/edgedb-mcp-server について

@obiwan90/edgedb-mcp-serverは、EdgeDBへのクエリと管理機能を提供し、コマンドラインやプロジェクトのライブラリからデータベースを扱う開発者向けです。データベース操作、EdgeQLクエリ、スキーマ確認に対応し、Cursorにも統合できます。

主な機能

  1. 01データベースへの接続と管理
  2. 02パラメーター付きEdgeQLクエリ
  3. 03フィルターやページネーション付きレコード検索
  4. 04型の確認とスキーマ比較
  5. 05コマンドラインツールまたはライブラリとして利用

活用シーン

  1. 01CursorからのEdgeDB操作
  2. 02EdgeQLクエリの実行とレコード検索
  3. 03データベースの型とスキーマ差分の確認

MCP 対応

MCPクライアントにEdgeDBの管理、クエリ、スキーマ管理ツールを公開し、MCPリソースも定義します。

設定

ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。

mcp.json · 共通設定
{
"mcpServers": {
"edgedb": {
"command": "npx",
"args": [
"-y",
"@obiwan90/edgedb-mcp-server"
]
}
}
}
起動コマンドnpx -y @obiwan90/edgedb-mcp-server

ローカルサーバーにはマシン上の実行環境(Node.js 18 以上など)が必要です。設定ファイルの場所はクライアントごとに異なります。

パッケージ
npm@obiwan90/edgedb-mcp-server

ツール

12

掲載時のツール一覧 · 3 週間前に更新

パラメーター型必須説明
dsnstringいいえEdgeDB 接続文字列(例:edgedb://user:password@hostname:port/database)
instanceNamestringいいえEdgeDB インスタンス名

詳細

npm バージョン ダウンロード総数 ライセンス パッケージサイズ

@obiwan90/edgedb-mcp-server

EdgeDB MCP サーバーは、EdgeDB データベースのクエリおよび管理機能を提供する、Model Context Protocol(MCP)ベースのツールです。コマンドラインツールとして使用することも、ライブラリとして他のプロジェクトに統合することもできます。

機能

  • データベース管理ツール

    • データベースに接続(DSN とインスタンス名に対応)
    • 利用可能なデータベースの一覧表示
    • データベースの新規作成
    • 現在のデータベースの切り替え
    • 現在のデータベース情報の取得
  • クエリツール

    • EdgeQL クエリの実行
    • パラメーターを指定した EdgeQL クエリの実行
    • 単一レコードの検索
    • 複数レコードの検索(フィルタリング、並べ替え、ページネーションに対応)
  • スキーマ管理ツール

    • 型の一覧表示(システム型を含めるかどうかを選択可能)
    • 型の詳細の取得
    • スキーマ構造の比較

インストール

一時的な実行(インストールなし)
npx -y @obiwan90/edgedb-mcp-server@latest
グローバルインストール
npm install -g @obiwan90/edgedb-mcp-server
プロジェクトの依存関係として追加
npm install @obiwan90/edgedb-mcp-server

使用方法

コマンドラインでの使用
# If installed globally
edgedb-mcp-server

# Or via npx for temporary execution
npx -y @obiwan90/edgedb-mcp-server
ライブラリとしての統合
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { registerAllTools } from "@obiwan90/edgedb-mcp-server/build/tools/index.js";
import { registerAllResources } from "@obiwan90/edgedb-mcp-server/build/resources/index.js";

// Initialize MCP server
const server = new McpServer({
    transport: new StdioServerTransport(),
    name: "EdgeDB MCP Server",
    description: "Providing EdgeDB database services through MCP protocol",
    version: "1.0.0"
});

// Register resources and tools
registerAllResources(server);
registerAllTools(server);

// Start the server
(async function() {
    try {
        const transport = new StdioServerTransport();
        await server.connect(transport);
        console.log("MCP server connected, waiting for client requests...");
    } catch (error) {
        console.error("Server startup failed:", error);
        process.exit(1);
    }
})();

環境変数

  • EDGEDB_DSN - EdgeDB データベース接続文字列
  • EDGEDB_INSTANCE - EdgeDB インスタンス名
  • DEBUG - デバッグモードを有効化(true/false)
  • LOG_LEVEL - ログレベル(デフォルト:info)

プロジェクト開発

ディレクトリ構成
src/
├── config/           # Configuration management
├── resources/        # MCP resource definitions
├── services/         # Service layer (EdgeDB connection management)
├── tools/            # MCP tool definitions
│   ├── database.ts   # Database management tools
│   ├── query.ts      # Query tools
│   ├── schema.ts     # Schema management tools
│   └── index.ts      # Tool exports
├── types/            # Type definitions
├── utils/            # Utility functions
└── index.ts          # Application entry point
プロジェクトのビルド
# Clone the project
git clone https://github.com/obiwan90/mcp-server-edgedb.git
cd mcp-server-edgedb

# Install dependencies
npm install

# Build the project
npm run build

# Start the service
npm start

Cursor との統合

この MCP サーバーを Cursor エディターと統合するには、次の手順に従ってください。

  1. Cursor の MCP 設定ファイル(~/.cursor/mcp.json)を編集します
  2. 次の設定を追加します。
"edgedb-server": {
  "command": "npx",
  "args": [
    "-y",
    "@obiwan90/edgedb-mcp-server@latest"
  ]
}
"edgedb-server": {
  "command": "npx",
  "args": [
    "-y",
    "@obiwan90/edgedb-mcp-server@latest",
    "--instanceName",
    "your-instance-name"
  ]
}
  1. Cursor エディターを再起動します
  2. これで Cursor で EdgeDB ツールを使用できます。コマンドパレット(Cmd+Shift+P)で「EdgeDB」を検索するか、チャットインターフェースからアクセスしてください。
Cursor dialog box input:

mcp_edgedb-server_connectEdgeDB(instanceName="your-instance-name")

ライセンス

このプロジェクトはMIT Licenseの下でライセンスされています。

コメント

MCP は初めてですか?

プロトコルの概要から最初のサーバーの導入まで、よくある疑問にまとめて答えます。

AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。