trackmcp
Back to directory
alvnavraii

mcpdatabasessse

View on GitHub

SSE Version of mcpDataabases

0 stars PythonServers & Infrastructure Updated Apr 24, 2025

Documentation

๐Ÿ—„๏ธ DataBaseSse Project (SSE Version)

This project is the SSE version of the original "stido" release available at https://github.com/alvnavraii/mcpDataBases. It includes improvements and adaptations for managing and migrating data between PostgreSQL and SQLite databases, with features exposed via Server-Sent Events (SSE).

๐Ÿ“ Main Structure

  • main.py: ๐Ÿ–ฅ๏ธ MCP server with tools to query, insert, update, delete, and modify tables in the PostgreSQL database, now with SSE support.
  • connection.py: ๐Ÿ”— Manages the connection to the PostgreSQL database.
  • pg_to_sqlite.py: ๐Ÿ”„ Script to migrate all tables and data from PostgreSQL to SQLite.
  • ecommerce.db: ๐Ÿ—ƒ๏ธ SQLite database generated from the migration (optional).

โš™๏ธ Features

  • CRUD operations: โž• Create, ๐Ÿ”Ž Read, โœ๏ธ Update, and โŒ Delete records in PostgreSQL database tables.
  • Table management: ๐Ÿ—๏ธ Easily create, ๐Ÿ› ๏ธ alter, and ๐Ÿ—‘๏ธ drop tables.
  • Data migration: ๐Ÿ”„ Automatic transfer of structure and data between PostgreSQL and SQLite.
  • Advanced queries: ๐Ÿงฎ Execute custom SQL queries for analysis or maintenance.
  • SSE support: ๐Ÿ“ก Real-time responses using Server-Sent Events for operations and notifications.

๐Ÿš€ Usage Examples

1. MCP Server (`main.py`)

  • Run the MCP server to expose database management tools with SSE:
bash
python3 main.py
  • Available tools:
    • ๐Ÿ”Ž `query_db(query)`: Executes SELECT queries and returns results via SSE.
    • โž• `insert_db(query)`: Executes INSERT statements and notifies via SSE.
    • โœ๏ธ `update_db(query)`: Executes UPDATE statements and notifies via SSE.
    • โŒ `delete_db(query)`: Executes DELETE statements and notifies via SSE.
    • ๐Ÿ—๏ธ `create_table(query)`: Executes CREATE TABLE statements and notifies via SSE.
    • ๐Ÿ› ๏ธ `alter_table(query)`: Executes ALTER TABLE statements and notifies via SSE.
    • ๐Ÿ—‘๏ธ `drop_table(query)`: Executes DROP TABLE statements and notifies via SSE.

2. Data migration between databases

  • Run the migration script to copy all tables and data from PostgreSQL to SQLite:
bash
python3 pg_to_sqlite.py
  • You can adapt the script to migrate data in both directions or between different schemas.

3. CRUD operation examples

  • Create a record: ๐Ÿ“
sql
INSERT INTO users (email, password) VALUES ('user@domain.com', 'secret');
  • Read records: ๐Ÿ”
sql
SELECT * FROM products WHERE is_active = TRUE;
  • Update records: ๐Ÿ”„
sql
UPDATE categories SET name = 'New Technologies' WHERE id = 1;
  • Delete records: ๐Ÿšฎ
sql
DELETE FROM carts WHERE created_at < '2024-01-01';

Frequently asked questions

What is mcpdatabasessse?

mcpdatabasessse is SSE Version of mcpDataabases

How do I install mcpdatabasessse?

Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

Is mcpdatabasessse open source?

Yes โ€” it is hosted on GitHub at https://github.com/alvnavraii/mcpDataBasesSSE.

Related MCP tools

Run your own MCP server? See who uses it and what to fix.

Measure it with TrackMCP