Skip to main content
Glama

Message Control Protocol (MCP) Server

by avhrst

Python Project

This is a Python project template with a basic structure.

Project Structure

. ├── README.md ├── requirements.txt ├── src/ │ └── main.py └── .gitignore

Setup

  1. Create a virtual environment (recommended):
    python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
  2. Install dependencies:
    pip install -r requirements.txt

Running the Project

To run the project:

python src/main.py

Development

  • Add your Python code in the src directory
  • Add new dependencies to requirements.txt
  • Update this README as needed

MCP Server with Oracle Database Integration

This is a Message Control Protocol (MCP) server implementation that provides a REST API for message handling with Oracle Database integration using ODBC.

Prerequisites

  • Python 3.8 or higher
  • Oracle Client installed and configured
  • ODBC Driver for Oracle installed

Installation

  1. Clone the repository
  2. Install the required dependencies:
pip install -r requirements.txt
  1. Configure the database connection:
    • Update the database settings in config.py
    • Make sure your Oracle ODBC driver is properly configured

Database Setup

Create the messages table in your Oracle database:

CREATE TABLE messages ( id NUMBER GENERATED ALWAYS AS IDENTITY PRIMARY KEY, content VARCHAR2(4000) NOT NULL, priority NUMBER DEFAULT 1, metadata VARCHAR2(4000), created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP );

Running the Server

Start the server with:

python main.py

The server will start on http://localhost:8000 by default.

API Endpoints

  • POST /messages/ - Create a new message
  • GET /messages/ - Retrieve all messages
  • GET /health - Health check endpoint

API Documentation

Once the server is running, you can access the interactive API documentation at:

  • Swagger UI: http://localhost:8000/docs
  • ReDoc: http://localhost:8000/redoc

Example Usage

Create a new message:

curl -X POST "http://localhost:8000/messages/" \ -H "Content-Type: application/json" \ -d '{"content": "Test message", "priority": 1, "metadata": {"key": "value"}}'

Get all messages:

curl "http://localhost:8000/messages/"

Error Handling

The server includes comprehensive error handling for:

  • Database connection issues
  • Query execution errors
  • Invalid input data
  • Server health monitoring

Security Considerations

  • Update the default configuration in config.py with your secure credentials
  • Consider implementing authentication and authorization
  • Use HTTPS in production
  • Implement rate limiting for production use
-
security - not tested
F
license - not found
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

A REST API server implementation for message handling with Oracle Database integration via ODBC, offering endpoints for creating and retrieving messages with comprehensive error handling.

  1. Project Structure
    1. Setup
      1. Running the Project
        1. Development
          1. MCP Server with Oracle Database Integration
            1. Prerequisites
            2. Installation
            3. Database Setup
            4. Running the Server
            5. API Endpoints
            6. API Documentation
            7. Example Usage
            8. Error Handling
            9. Security Considerations

          Related MCP Servers

          • -
            security
            F
            license
            -
            quality
            Facilitates interaction with a local MySQL database via a RESTful API, supporting database queries and real-time updates with integration for Cursor MCP services.
            Last updated -
            2
            JavaScript
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol server that provides standardized interfaces for interacting with Ollama API, offering JSON responses, error handling, and intelligent guidance for LLM-based API calls.
            Last updated -
            Python
            MIT License
            • Linux
            • Apple
          • -
            security
            A
            license
            -
            quality
            A Model Context Protocol Server that enables LLMs to interact with Oracle Database by providing database tables/columns as context, allowing users to generate SQL statements and retrieve results using natural language prompts.
            Last updated -
            15
            Python
            Apache 2.0
          • -
            security
            A
            license
            -
            quality
            A server that provides management and connectivity for Alibaba Cloud RDS database services via OpenAPI, enabling users to create, query, and modify RDS instances through MCP integration.
            Last updated -
            29
            Python
            Apache 2.0

          View all related MCP servers

          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/avhrst/mcp'

          If you have feedback or need assistance with the MCP directory API, please join our Discord server