Confidential guide on numerology and astrology, based of GG33 Public information

modèle_context_protocol_examples
Quelques exemples pour créer un serveur, un test client dans le protocole de contexte de modèle. Một số ví dụ sử dụng mcp
3 years
Works with Finder
1
Github Watches
0
Github Forks
0
Github Stars
SQLite Database Demo
This project demonstrates the usage of SQLite database with async support in a FastMCP application.
Features
- Async SQLite database operations using
aiosqlite
- Automatic database initialization with sample data
- Type-safe database context management
- Proper connection lifecycle handling
Prerequisites
- Python 3.7+
- pip (Python package installer)
Installation
- Clone this repository
- Install the required dependencies:
pip install -r requirements.txt
Project Structure
-
server.py
: Main FastMCP server implementation with database context management -
database.py
: SQLite database implementation with async support -
demo.db
: SQLite database file (created automatically on first run)
Database Schema
The demo database includes a users
table with the following structure:
CREATE TABLE users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
email TEXT UNIQUE NOT NULL
)
Sample data is automatically inserted on first run:
- John Doe (john@example.com)
- Jane Smith (jane@example.com)
Usage
- Start the server:
python server.py
-
The database will be automatically initialized with the sample data on first run.
-
Use the
query_db
tool to retrieve data from the database.
Database Operations
The Database
class provides the following methods:
-
connect()
: Creates a new database connection and initializes the schema -
query()
: Executes a sample query to retrieve all users -
disconnect()
: Closes the database connection
Customization
To modify the database schema or add new tables:
- Edit the
_init_db()
method indatabase.py
- Add new methods to
Database
class for custom queries - Update the
query_db
tool inserver.py
to use new methods
Error Handling
The database implementation includes:
- Automatic connection cleanup on server shutdown
- Proper async context management
- Type safety with Python type hints
Dependencies
- aiosqlite>=0.19.0: Async SQLite database driver
- pandas>=2.0.0: Data manipulation library
- numpy>=1.24.0: Numerical computing library
相关推荐
Advanced software engineer GPT that excels through nailing the basics.
Take an adjectivised noun, and create images making it progressively more adjective!
Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease
I find academic articles and books for research and literature reviews.
Découvrez la collection la plus complète et la plus à jour de serveurs MCP sur le marché. Ce référentiel sert de centre centralisé, offrant un vaste catalogue de serveurs MCP open-source et propriétaires, avec des fonctionnalités, des liens de documentation et des contributeurs.
Manipulation basée sur Micropython I2C de l'exposition GPIO de la série MCP, dérivée d'Adafruit_MCP230XX
Miroir dehttps: //github.com/bitrefill/bitrefill-mcp-server
MCP Server pour récupérer le contenu de la page Web à l'aide du navigateur sans tête du dramwright.
Un bot de chat IA pour les petites et moyennes équipes, soutenant des modèles tels que Deepseek, Open AI, Claude et Gemini. 专为中小团队设计的 Ai 聊天应用 , 支持 Deepseek 、 Open Ai 、 Claude 、 Gemini 等模型。
Un puissant plugin Neovim pour gérer les serveurs MCP (Protocole de contexte modèle)
Pont entre les serveurs Olllama et MCP, permettant aux LLM locaux d'utiliser des outils de protocole de contexte de modèle
Reviews

user_Qacl6PFJ
Model_context_protocol_examples is an excellent resource created by anhnx000. The repository on GitHub provides clear examples and thorough explanations. It's incredibly useful for anyone looking to understand and implement model context protocols efficiently. Highly recommended for developers seeking to enhance their knowledge in this area.