Simple MCP Server
A simple Model Context Protocol (MCP) server that provides value lookup operations. This server implements a basic key-value store that can be accessed by MCP-compatible AI assistants and clients.
Features
- In-memory key-value store: Store and retrieve data during the session
- JSON support: Automatically parses and formats JSON values
- Multiple operations: Get, set, delete, list, and clear operations
- MCP protocol compliance: Uses the standard MCP protocol for communication
- Easy integration: Can be used with any MCP-compatible client
Available Tools
The server provides the following tools that can be called by MCP clients:
get_value
Retrieve a value from the store by key.
- Parameters:
key
(string) - The key to look up - Returns: The value associated with the key, or an error message if not found
set_value
Store a key-value pair in the store.
- Parameters:
key
(string) - The key to storevalue
(string) - The value to store (automatically parsed as JSON if valid)
- Returns: Confirmation message
delete_value
Remove a key-value pair from the store.
- Parameters:
key
(string) - The key to delete - Returns: Confirmation message
list_keys
List all keys currently in the store.
- Parameters: None
- Returns: A formatted list of all keys
clear_values
Clear all key-value pairs from the store.
- Parameters: None
- Returns: Confirmation message
get_store_info
Get information about the current state of the store.
- Parameters: None
- Returns: Store statistics and sample keys
Installation
- Clone this repository:
- Install dependencies:
Usage
Running the Server
Start the MCP server using stdio transport:
Or run directly with Python:
Testing the Server
You can test the server functionality using the included test script:
This will demonstrate all available operations and show you how the server responds.
Using with MCP Clients
The server can be used with any MCP-compatible client. Configure your client to connect to this server using stdio transport.
Example client configuration (varies by client):
Example Operations
Here are some example operations you can perform:
Architecture
The server is built using:
- FastMCP: A high-level MCP server framework
- JSON-RPC 2.0: For client-server communication
- Pydantic: For data validation and serialization
- asyncio: For asynchronous operation
The value store is currently in-memory only, meaning data is lost when the server restarts. This makes it suitable for temporary storage and demonstration purposes.
Development
To set up for development:
License
This project is licensed under the MIT License - see the LICENSE file for details.
.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A lightweight Model Context Protocol server that provides an in-memory key-value store with get, set, delete, list, and clear operations for MCP-compatible AI assistants and clients.
Related MCP Servers
- -securityFlicense-qualityA comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.Last updated -61TypeScript
- -securityFlicense-qualityA Model Context Protocol server that provides AI models with structured access to external data and services, acting as a bridge between AI assistants and applications, databases, and APIs in a standardized, secure way.Last updated -1Python
- AsecurityFlicenseAqualityA Model Context Protocol (MCP) server that enables AI assistants to perform comprehensive file operations including finding, reading, writing, editing, searching, moving, and copying files with security validations.Last updated -7TypeScript
- AsecurityFlicenseAqualityA collection of Model Context Protocol servers providing advanced capabilities for AI assistants including professional accuracy enforcement, tool safety protocols, user preference management, and intelligent context monitoring.Last updated -5JavaScript