MCP Database Server
MCP データベース サーバー
大規模言語モデル(LLM)が自然言語を介して様々なデータベースと対話できるようにする、モデルコンテキストプロトコル(MCP)サーバー実装。現在MongoDBをサポートしており、今後以下のデータベースへのサポートも予定されています。
PostgreSQL
コックローチDB
レディス
さらに…
特徴
自然言語によるデータベース操作
現在、以下の機能を備えた MongoDB をサポートしています:
すべてのコレクションを一覧表示する
フィルタリングと投影によるドキュメントのクエリ
ドキュメントを挿入する
ドキュメントを削除する
集約パイプライン操作
他のデータベースの将来のサポート:
PostgreSQL: SQLクエリ、テーブル操作
CockroachDB: 分散SQL操作
Redis: キー値操作、キャッシュ
Related MCP server: MongoDB
前提条件
Node.js v20.12.2 以上
データベース(現在は MongoDB、他のデータベースも近日中に提供予定)
クロードデスクトップアプリケーション
インストール
リポジトリをクローンします。
git clone https://github.com/manpreet2000/mcp-database-server.git
cd mcp-database-server依存関係をインストールします:
npm installTypeScript コードをビルドします。
npm run build構成
開始するには、Claude Desktop 構成ファイルでデータベース接続を構成する必要があります。
macOS
~/Library/Application\ Support/Claude/claude_desktop_config.jsonウィンドウズ
%APPDATA%/Claude/claude_desktop_config.jsonclaude_desktop_config.jsonに次の構成を追加します。
{
"mcpServers": {
"database": {
"command": "/path/to/node",
"args": ["/path/to/mcp-database/dist/index.js"],
"env": {
"MONGODB_URI": "your-mongodb-connection-string"
}
}
}
}交換する:
/path/to/nodeをNode.js実行ファイルのパスに置き換えるか、単にnodeを使用します。/path/to/mcp-databaseにこのリポジトリへの絶対パスを記述しますyour-mongodb-connection-stringMongoDB 接続 URL に置き換えます。
使用例
MongoDBの例
データベース内のすべてのコレクションを一覧表示します。
Can you show me all the collections in my database?コレクションから特定のレコードを取得します。
Give me 2 records from the chargers collectionフィルターを使用したクエリ:
Show me all documents in the users collection where status is activeドキュメントを挿入します:
Add a new user to the users collection with name John and email john@example.comドキュメントを削除します。
Remove the user with email john@example.com from the users collection集計データ:
Show me the total count of users by status in the users collection利用可能なツール
1. getCollections
接続されたデータベース内のすべてのコレクションを一覧表示します。
2. getCollection
オプションのクエリ パラメータを使用してコレクションからドキュメントを取得します。
collectionName: コレクションの名前limit: 返されるドキュメントの最大数(デフォルト: 10、最大: 1000)query: MongoDBクエリオブジェクトprojection: 含める/除外するフィールド
3. 挿入One
コレクションに単一のドキュメントを挿入します。
collectionName: コレクションの名前document: 挿入するドキュメントオブジェクト
4. 1つ削除
コレクションから単一のドキュメントを削除します。
collectionName: コレクションの名前query: 削除する文書に一致するクエリ
5. 集計
集計パイプラインを実行します。
collectionName: コレクションの名前pipeline: 集約ステージの配列options: オプションの集計オプション
将来のデータベースサポート
PostgreSQL
SQLクエリ実行
テーブル操作
スキーマ管理
取引サポート
コックローチDB
分散SQL操作
マルチリージョンサポート
トランザクション管理
スキーマ操作
レディス
キー値操作
キャッシュメカニズム
パブリッシュ/サブスクライブ操作
データ構造操作
安全
データベース接続文字列をバージョン管理にコミットしないでください
機密情報には環境変数を使用する
データベース固有のセキュリティのベストプラクティスに従う
貢献
貢献を歓迎します!お気軽にプルリクエストを送信してください。大きな変更については、まずIssueを開いて、変更したい点について議論してください。
ライセンス
MITライセンス - 詳細はライセンスをご覧ください
Available Tools
5 toolsaggregateD
| Name | Required | Description | Default |
|---|---|---|---|
| collectionName | Yes | ||
| pipeline | Yes | ||
| options | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
deleteOneD
| Name | Required | Description | Default |
|---|---|---|---|
| collectionName | Yes | ||
| query | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
getCollectionD
| Name | Required | Description | Default |
|---|---|---|---|
| collectionName | Yes | ||
| limit | No | ||
| query | No | ||
| projection | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
getCollectionsD
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
insertOneD
| Name | Required | Description | Default |
|---|---|---|---|
| collectionName | Yes | ||
| document | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
- First observed
aggregate - First observed
deleteOne - First observed
getCollection - First observed
getCollections - First observed
insertOne
TDQS
Scored across 5 tools
The tools have distinct purposes: aggregate, deleteOne, getCollection, getCollections, and insertOne each target different database operations. However, getCollection and getCollections could potentially be confused due to similar naming and lack of descriptions clarifying their exact differences.
Naming is inconsistent with mixed conventions: getCollection and getCollections use camelCase, while deleteOne and insertOne use camelCase with different verb styles, and aggregate stands alone. There is no predictable pattern across all tools.
With 5 tools, the count is reasonable for a database server, but it feels borderline thin for covering full CRUD operations and database management. Key operations like update or query filtering are missing, making the set feel incomplete.
The tool set has significant gaps for a database server: it lacks update operations, query filtering tools, and transaction management. While basic insert, delete, and get operations are present, the surface is incomplete for typical database workflows, likely causing agent failures.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
- mcpOAuthcom.gibsonai
GibsonAI MCP server: manage your databases with natural language
Text-to-SQL MCP server: read-only queries on PostgreSQL, MySQL and SQL Server with your real schema
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server that enables LLMs to interact directly with MongoDB databases. Query collections, inspect schemas, and manage data seamlessly through natural language.34 npm175MIT
- AlicenseBqualityAmaintenanceA Model Context Protocol server that provides access to MongoDB databases. This server enables LLMs to inspect collection schemas and execute read-only queries.8222 npm282MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables LLMs to interact directly with MongoDB databases, allowing users to query collections, inspect schemas, and manage data through natural language.34 npm2MIT
- AlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that enables LLMs to interact directly with MongoDB databases, allowing users to query collections, inspect schemas, and manage data through natural language.34 npmMIT