Skip to main content

Simple MCP Server Collection, Packaged

Project description

mcp-servers

A Python package providing a collection of Model-Control-Protocol (MCP) servers and a CLI tool to manage them efficiently.

Disclaimer

This project is created for personal use and does not guarantee stable behavior. It is made public solely as a reference for other programmers. The project is currently in early development, potentially unstable, and may produce undesired outcomes. Use at your own risk.


Overview

mcp-servers implements Model-Control-Protocol servers for various integrations:

  • Filesystem access
  • Brave Search integration
  • SearXNG search integration
  • Tavily Search integration

These servers can be used by AI agents to interact with your system and external services in a controlled manner.

Pre-requisites

  • Python 3.12+
  • uv (optional but recommended package/environment manager)
  • podman or docker for container operations (e.g., running local SearXNG instance)
  • OpenRouter API key and credits (for experimentation with examples)

Installation

Package Managers

Using uv (recommended)

uv venv --python 3.12
source .venv/bin/activate
uv pip install --upgrade mcp-servers

Using pip

pip install --upgrade mcp-servers

Development Setup

git clone git@github.com:assagman/mcp_servers.git
cd mcp_servers
uv venv --python 3.12
source .venv/bin/activate
uv sync --extra dev

Configuration

The package requires specific configuration files in your home directory. Initialize everything at once with:

mcpserver init

This command will:

  • Create ~/.mcp_servers/.env → MCP Server HOST:PORTs, API KEYs, URLs, etc.
  • Create ~/.mcp_servers/searxng_config/settings.yml → Configuration for local SearXNG instance

⚠️ Important: You must set your own API keys in the generated .env file. They are left empty by default.

For environment variable reference, see .env.example

Usage

CLI Tool

This package provides a CLI tool (mcpserver) to manage configuration, MCP servers, and external container operations:

mcpserver -h  # Show help

Server Management

Each MCP server can be started in standard mode or detached mode. Detached mode runs the server in the background.

Filesystem Server
# Start with temporary directory
mcpserver start --server filesystem

# Operate on specific directory
mcpserver start --server filesystem --allowed-dir $(pwd)

# Custom port
mcpserver start --server filesystem --port 8765 --allowed-dir $(pwd)

# Detached mode
mcpserver start --server filesystem --detached
mcpserver stop --server filesystem  # Stop detached server
Brave Search Server

Requires BRAVE_API_KEY environment variable.

# Start server
mcpserver start --server brave_search

# Custom port
mcpserver start --server brave_search --port 8766

# Detached mode
mcpserver start --server brave_search --detached
mcpserver stop --server brave_search  # Stop detached server
SearXNG Search Server

Requires SEARXNG_BASE_URL environment variable.

# Start local SearXNG container
mcpserver run_external_container --container searxng

# Start server
mcpserver start --server searxng_search

# Custom port
mcpserver start --server searxng_search --port 8767

# Detached mode
mcpserver start --server searxng_search --detached
mcpserver stop --server searxng_search  # Stop detached server

# Stop SearXNG container
mcpserver stop_external_container --container searxng
Tavily Search Server

Requires TAVILY_API_KEY environment variable.

# Start server
mcpserver start --server tavily_search

# Custom port
mcpserver start --server tavily_search --port 8768

# Detached mode
mcpserver start --server tavily_search --detached
mcpserver stop --server tavily_search  # Stop detached server

Python API

The package can also be imported and used programmatically. See example files in examples/package_usage

Examples

The package includes examples demonstrating Agent-MCP Server usage with pydantic_ai Agents. All examples use MCPServerHTTP to connect agents with MCP Servers.

To experiment with all MCP servers:

  1. Set BRAVE_API_KEY in ~/.mcp_servers/.env (for Brave search server)
  2. Set OPENROUTER_API_KEY in ~/.mcp_servers/.env (required for all examples)
  3. Start SearXNG container (for SearXNG search server)

CLI Usage Examples

See examples/cli_usage for examples requiring MCP servers to be started via the CLI commands mentioned above.

Package Usage Examples

See examples/package_usage for examples that can be executed as-is.

Advanced Usage

Custom Configuration

You can customize server behavior by modifying configuration files:

# Edit SearXNG settings
vim ~/.mcp_servers/searxng_config/settings.yml

# Edit environment variables
vim ~/.mcp_servers/.env

Multiple Servers

You can run multiple MCP servers simultaneously by specifying different ports:

mcpserver start --server filesystem --port 8765 --detached
mcpserver start --server brave_search --port 8766 --detached
mcpserver start --server searxng_search --port 8767 --detached
mcpserver start --server tavily_search --port 8768 --detached

Troubleshooting

Common Issues

  1. API Keys Not Working: Ensure you've set the correct API keys in ~/.mcp_servers/.env
  2. Port Conflicts: If a port is already in use, specify a different port with --port
  3. Container Issues: Use podman logs searxng or docker logs searxng to diagnose SearXNG container problems

Testing Specifications

  • Tested on macOS (arm64)
  • Python 3.12

License

This project is provided as-is with no warranty. See the LICENSE file for details.

Contributing

Contributions are welcome but not expected. If you find a bug or have a feature request, please consider forking this repo and use your own custom version.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_servers-0.1.7.tar.gz (40.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_servers-0.1.7-py3-none-any.whl (59.1 kB view details)

Uploaded Python 3

File details

Details for the file mcp_servers-0.1.7.tar.gz.

File metadata

  • Download URL: mcp_servers-0.1.7.tar.gz
  • Upload date:
  • Size: 40.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for mcp_servers-0.1.7.tar.gz
Algorithm Hash digest
SHA256 2de8684de9f52dbca30df69f854299b276d07eca941afde14c846d5e1a9ee65a
MD5 dd05bcebe6410e37a275ca94144f9603
BLAKE2b-256 a5c81d41d9f2a4d58007085e12ad3ac6d6afc36b82623dbc65089f62351e6e93

See more details on using hashes here.

File details

Details for the file mcp_servers-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: mcp_servers-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 59.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for mcp_servers-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 423a86a65b7e11834f7e3d7e7b642d0a0fd1dc5d168ef7f4865b2cc2f59291ce
MD5 e7a59c5d51cae7fad9f3453a0920a7f5
BLAKE2b-256 139b4c713cfd09a4b3f5b2814f22f129b7863206be3233f4e634bd23921271a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page