Relational DB Seeder MCP Server
Provides tools for inspecting schemas, seeding relational data, and executing queries on PostgreSQL databases, with automatic foreign key resolution.
Provides tools for inspecting schemas, seeding relational data, and executing queries on SQLite databases, with automatic foreign key resolution.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Relational DB Seeder MCP Serverseed the database with sample departments and employees"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Relational DB Seeder MCP Server
An intelligent, schema-aware, fully asynchronous Model Context Protocol (MCP) server that enables LLMs (like Claude) to inspect database structures and seed relational databases with custom, semantic data while preserving foreign key integrity in a single payload.
This is a developer tool designed to bridge the gap between AI reasoning and database populating. Instead of requiring the LLM to make multiple slow, sequential tool calls to resolve auto-generated IDs, the server parses constraints, sorts tables topologically, and maps generated IDs to foreign keys automatically.
๐ Key Features
Multi-Database Support: Out-of-the-box support for both SQLite (local files) and PostgreSQL databases, configured on startup via environment variables.
Automatic Relative Path Resolution: Any relative SQLite path (e.g.
sqlite:///employee.db) is automatically resolved relative to the server's project root directory, keeping database files in a predictable location regardless of where the client runs.Relational Graph Insertion: Seeds complex tables with relationships in one batch. LLMs can reference parent rows using labels like
ref:users:alice_tempand the engine automatically resolves them to real database-generated primary keys.Fully Asynchronous: High-performance database operations powered by
aiosqliteand the modernpsycopg(v3) async library.Schema Auto-Discovery: Queries database catalogs (
information_schemaand SQLite pragma lists) to dump tables, columns, constraints, and relationships for the LLM to reason about.Credential Masking: Built-in security that automatically hides database passwords and user credentials in server logs and returned status states.
Related MCP server: database-explorer-mcp
๐ ๏ธ Architecture
db_seeder/
โโโ adapters/
โ โโโ __init__.py
โ โโโ base.py # Base connection interface using abc.ABC
โ โโโ sqlite.py # SQLite async adapter using aiosqlite
โ โโโ postgres.py # PostgreSQL async adapter using psycopg
โโโ core/
โ โโโ __init__.py
โ โโโ graph.py # Topological sort & cycle detector
โ โโโ seeder.py # Relational graph insertion engine
โโโ tests/ # Unit & integration tests๐ฆ Installation & Setup
Ensure you have uv or standard Python 3.14+ installed.
1. Clone & Install Dependencies
git clone https://github.com/yourusername/DB_Seeder.git
cd DB_Seeder
uv sync2. Run the MCP Server Locally
You can run the server in development mode using fastmcp:
uv run fastmcp dev server.py3. Add to Claude Desktop Configuration
To connect this server to your Claude Desktop application, edit your claude_desktop_config.json:
MacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Add the server connection (defining the DATABASE_URL for your target SQLite or Postgres database):
{
"mcpServers": {
"db-seeder": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/DB_Seeder",
"run",
"server.py"
],
"env": {
"DATABASE_URL": "sqlite:///employee.db"
}
}
}
}๐ง Expose Tools
The server registers the following asynchronous MCP tools with the client:
Tool | Parameters | When to Use | Description |
| None | At the start of a session or when checking DB configuration. | Returns active database type, table list, and connection details (credentials masked). |
| None | Before writing queries or generating mock data payloads. | Dumps all columns, types, nullability, primary keys, and foreign keys. |
|
| Preferred tool for inserting records and database seeding. | Inserts a relational dataset, mapping and resolving parent keys. |
|
| For SELECT checks, DDL schemas (CREATE, ALTER), or updates. | Runs arbitrary SQL statements on the connected database. |
๐ Relational Graph Seeding Example
When seeding, the LLM agent sends a payload where parent tables have a __temp_id and child tables refer to them using the format ref:parent_table:temp_id.
Payload sent by LLM:
{
"departments": [
{
"__temp_id": "d1",
"dept_name": "Engineering"
},
{
"__temp_id": "d2",
"dept_name": "Sales"
}
],
"employees": [
{
"name": "Alice Smith",
"email": "alice@company.com",
"number": "555-1234",
"salary": 85000,
"dept_id": "ref:departments:d1"
},
{
"name": "Bob Johnson",
"email": "bob@company.com",
"number": "555-5678",
"salary": 72000,
"dept_id": "ref:departments:d2"
}
]
}Seeder Execution Steps:
Detects that
employeesdepends ondepartmentsvia the foreign key constraint ondept_id.Sorts the insertion order:
departmentsfirst, thenemployees.Inserts departments, capturing their database-generated primary keys (e.g.
Engineering -> 1,Sales -> 2).Replaces
"ref:departments:d1"with1and"ref:departments:d2"with2in the employees payload.Inserts employees, guaranteeing that no foreign key constraint violations occur.
๐งช Testing
The project has robust unit and integration tests written using pytest and pytest-asyncio. Run them with:
PYTHONPATH=. uv run pytestAvailable Tools
4 toolsexecute_queryA
Execute arbitrary SQL statements on the connected database.
When to use: Use this tool for read operations (e.g., SELECT queries to verify data), schema modification (e.g., CREATE TABLE, ALTER TABLE, DDL statements), or updates. DO NOT use this for inserting mock/seed records; use insert_graph instead.
Args: query: SQL string to execute.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of disclosure. It mentions 'arbitrary SQL' and schema modification, implying destructive potential, but does not explicitly state risks like irreversible data loss, required permissions, transaction behavior, or side effects. The agent is left unaware of important consequences beyond the basic fact that it executes SQL.
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?
The description is concise and front-loaded, starting with the core purpose then providing usage guidance and arguments. It has no filler and is logically structured with clear sections, making it easy to scan.
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?
Although output schema exists, this tool executes arbitrary SQL, so high-impact context is needed. The description omits security/safety warnings, error behavior, transactional guarantees, and any limits on query complexity or resource usage. It also only disambiguates from insert_graph, not from get_schema or get_database_status, leaving part of the sibling context incomplete.
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?
Schema description coverage is 0%, so the description must compensate. The only parameter info is 'query: SQL string to execute,' which adds minimal meaning over the schema's 'query' string type. It does not explain whether multiple statements are allowed, expected SQL dialect, or any format/escaping requirements, leaving significant ambiguity.
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?
The description states 'Execute arbitrary SQL statements on the connected database' with specific examples (SELECT, CREATE TABLE, ALTER TABLE, updates), clearly defining the tool's scope. It explicitly distinguishes from sibling insert_graph by warning not to use it for mock/seed records, thus differentiating itself from the primary alternative.
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?
The 'When to use' section explicitly lists valid use cases (read operations, schema modification, updates) and provides an explicit exclusion ('DO NOT use this for inserting mock/seed records') with a named alternative tool (insert_graph). This is exactly the kind of when/when-not guidance expected.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_database_statusA
Check the connection status and details of the active database.
When to use: Use this tool at the start of a session or when you need to verify which database engine (SQLite or PostgreSQL) is connected and list the available tables.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It clearly indicates this is a read-only status operation ('Check', 'list'), and it specifies what information is available (engine and tables). It does not mention potential errors or permission requirements, but for a simple status tool this is adequate.
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?
The description is two sentences, front-loaded with the main action, and directly followed by applicable usage context. Every sentence earns its place; there is no redundant detail.
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?
For a simple status-checking tool with no parameters and an output schema, this description is complete. It covers purpose, the engine types, the available tables, and when to invoke it. The output schema may provide additional return details, so the description does not need to enumerate them.
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?
The tool has zero parameters, so the baseline is 4. The description adds no parameter-specific semantics, but none are needed since the schema is empty and the tool's behavior is fully described without parameters.
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?
The description uses a specific verb ('Check') and a clear resource ('the active database'), and it explicitly distinguishes this tool from siblings by focusing on connection status and the database engine (SQLite or PostgreSQL). This is not a tautology and is clearly distinct from get_schema, execute_query, and insert_graph.
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?
The description provides explicit guidance: 'Use this tool at the start of a session or when you need to verify which database engine is connected and list the available tables.' This tells the agent exactly when to use it, though it does not name alternatives directly. The context is clear and actionable.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_schemaA
Retrieve the complete schema layout of the active database.
When to use: Call this tool before writing queries or generating mock data payloads. It provides columns, data types, nullability, primary keys, and foreign key relationships for all tables, which is necessary to plan referential insert operations.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the burden of behavioral disclosure. It explains that the tool returns columns, data types, nullability, primary keys, and foreign keys for all tables, and scopes to the active database. It implies a read-only operation via 'Retrieve'. It lacks explicit side-effect or rate-limit notes, but for a retrieval tool this is sufficient.
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?
The description is extremely concise: two sentences. The first states the action and scope, the second supplies usage context. Every word earns its place with no filler or redundancy.
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?
Given zero parameters, an existing output schema, and no nested objects, the description fully covers the tool's purpose and usage. It explains what data is returned and when to use it, making it complete for an AI agent to invoke correctly.
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?
The tool has zero parameters, so the baseline is 4. The schema description coverage is 100% with an empty schema, and no parameter details are needed. The description adds no parameter semantics, but none are required.
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?
The description clearly states a specific action ('Retrieve') and resource ('complete schema layout of the active database'). It distinguishes itself from sibling tools by focusing on schema structure rather than database status, graph insertion, or query execution.
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?
The description explicitly provides when-to-use guidance: 'Call this tool before writing queries or generating mock data payloads'. It also explains why it's necessary for referential insert operations. While it doesn't mention when not to use it or name alternatives, the context is clear and actionable.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
insert_graphA
Seed mock, test, or relational data rows into the database. Supports inserting entries into multiple tables at the same time in a single payload.
When to use: This is the PREFERRED and recommended tool for inserting data records into the database. Use this instead of executing raw SQL INSERT statements. It handles table dependencies, resolves auto-generated parent IDs dynamically, and ensures safe transactions.
CRITICAL: The payload must map table names to a list of DICTIONARIES (not lists or arrays of values). Each dictionary must map column names to their values.
Example input payload: { "users": [ { "__temp_id": "u1", "name": "Alice Smith", "email": "alice@example.com" } ], "posts": [ { "title": "My First Post", "author_id": "ref:users:u1" } ] }
Args: payload: Dict mapping table name to a list of dict objects representing rows. Rows can specify "__temp_id" (e.g. "u1"). Foreign keys can refer to parents using "ref:parent_table:temp_id" (e.g. "ref:users:u1").
| Name | Required | Description | Default |
|---|---|---|---|
| payload | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
No output parameters | ||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so the description carries the burden. It discloses transaction safety, dynamic parent-ID resolution, and table-dependency handling. It also warns about payload format. Missing details like auth requirements are not relevant here, and the mutation nature is self-evident.
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?
Although lengthy, the description is well-structured: a one-sentence summary, a 'When to use' paragraph, a 'CRITICAL' note, an example, and an args section. Every sentence adds value; no filler.
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?
Given the output schema exists, the description doesn't need to detail returns. It covers when to use, payload format, and example, leaving no critical gaps. The tool's complexity is fully addressed.
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?
Schema coverage is 0%, but the description compensates with a detailed explanation of the payload structure, including required dictionary mapping, __temp_id and ref syntax, and a concrete example. This is exemplary parameter documentation.
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?
The description opens with a specific verb+resource: 'Seed mock, test, or relational data rows into the database.' It also explicitly contrasts with the sibling 'execute_query' by stating it should be used instead of raw SQL INSERT, making its purpose distinct.
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?
States 'When to use' and explicitly says 'PREFERRED and recommended tool for inserting data records' and 'Use this instead of executing raw SQL INSERT statements.' It also gives reasons: handles dependencies, resolves IDs, ensures safe transactions. This clearly differentiates from siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
Each tool serves a clearly distinct purpose: status check, schema retrieval, graph-based seeding, and arbitrary SQL execution. The descriptions explicitly distinguish insert_graph from execute_query, leaving no ambiguity about when to use which.
All tool names follow the same verb_noun pattern in snake_case: get_database_status, get_schema, insert_graph, execute_query. This consistent convention makes the toolset easy to learn and predict.
With only 4 tools, the server is tightly focused on its purpose of seeding relational databases. Each tool is necessary and none is redundant, making the scope well-calibrated.
The toolset covers the full workflow: inspecting database status, reading schema, inserting relational data with dependency handling, and executing arbitrary SQL for validation or modifications. No obvious gaps for the seeder domain.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Generate realistic, FK-consistent synthetic test data for your databases from your AI assistant.
Database for your AI agent. Turn its output into data, docs, skills, and apps you can actually use.
Safe, read-only Postgres and MySQL access for AI agents. Audit log + column-level controls.
Query PostgreSQL databases in plain English โ LLM-generated, safety-validated SQL.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables LLM agents to perform complete database operations on SQLite databases, including creating tables, executing queries, and managing data through CRUD operations with schema inspection capabilities.32MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to connect to and interact with PostgreSQL, MySQL, SQLite, and MongoDB databases through natural language, supporting schema exploration, query execution, data export, and more.MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI tools to understand a database, inspect schema, and run safe SELECT queries with SQL guardrails, plus optional codebase reading.
- AlicenseAqualityDmaintenanceGenerates realistic, referentially-coherent test data (SQL INSERTs, JSON, or CSV) from your database schema, resolving foreign keys and respecting constraints. Paste CREATE TABLE DDL or a JSON schema and get ready-to-run seed data with valid relationships.287MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/NamanT98/DB-Seeder'
If you have feedback or need assistance with the MCP directory API, please join our Discord server