MCP Employee API Server

MCP Employee API Server

Enables AI assistants to manage employee data through a REST API with full CRUD operations. Provides tools to create, read, update, and delete employee records via the Model Context Protocol.

Category
Visit Server

README

MCP Employee API Server

A Model Context Protocol (MCP) server that provides tools for managing employee data through a REST API. This server exposes employee management operations as MCP tools that can be used by AI assistants and other MCP clients.

Features

  • Employee Management: Full CRUD operations for employee data
  • REST API Integration: Connects to a local employee API server
  • MCP Protocol: Exposes functionality through the Model Context Protocol
  • Async Operations: Built with async/await for optimal performance
  • Error Handling: Robust error handling for API requests

Available Tools

The server provides the following MCP tools:

  • get_employees() - Retrieve all employees
  • get_employee(id) - Get a specific employee by ID
  • add_employee(name, age) - Create a new employee
  • update_employee(id, name, age) - Update an existing employee
  • delete_employee(id) - Delete an employee by ID

Prerequisites

  • Python 3.13 or higher
  • A running employee API server at http://localhost:8000

Installation

  1. Clone the repository:

    git clone https://github.com/JoseGarayar/mcp_test.git
    cd mcp_test
    
  2. Clone the api employee repository:

    git clone https://github.com/JoseGarayar/api_employees.git
    
  3. Install dependencies using uv:

    uv sync
    

Usage

Running the MCP Server

Start the MCP server using stdio transport:

uv run python main.py

The server will run and listen for MCP protocol messages via stdin/stdout.

API Configuration

The server is configured to connect to a local API server at http://localhost:8000. You can modify the URL_BASE constant in main.py to point to a different API endpoint.

Example API Endpoints

The server expects the following API endpoints to be available:

  • GET /employees - List all employees
  • GET /employees/{id} - Get employee by ID
  • POST /employees - Create new employee
  • PUT /employees/{id} - Update employee
  • DELETE /employees/{id} - Delete employee

Development

Project Structure

mcp_test/
├── main.py          # Main MCP server implementation
├── pyproject.toml   # Project configuration and dependencies
├── README.md        # This file
└── uv.lock         # Lock file for dependencies

Dependencies

  • httpx - Async HTTP client for API requests
  • mcp[cli] - Model Context Protocol implementation

Development Dependencies

  • ruff - Python linter and formatter

Error Handling

The server includes comprehensive error handling:

  • Network timeouts (30 seconds)
  • HTTP error status codes
  • Invalid HTTP methods
  • Connection failures

All errors are gracefully handled and return None for failed operations.

License

This project is part of a test implementation for MCP server development.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured