Skip to main content
Glama

MCP Wikipedia Server

by kaman05010
QUICK_REF.mdโ€ข2.98 kB
# MCP Wikipedia Server - Quick Reference ## ๐Ÿš€ Quick Start Commands ```bash # 1. Activate environment source .venv311/bin/activate # 2. Start server cd src/mcp_server && python mcp_server.py # 3. Test in another terminal python mcp_client.py ``` ## ๐Ÿ”ง Available Tools | Tool | Purpose | Parameters | |------|---------|------------| | `fetch_wikipedia_info` | Search & get article summary | `query: str` | | `list_wikipedia_sections` | Get article section titles | `topic: str` | | `get_section_content` | Get specific section content | `topic: str, section_title: str` | ## ๐Ÿ› ๏ธ Common Commands ### Environment Management ```bash # Check Python version python --version # Activate virtual environment source .venv311/bin/activate # Install/update packages pip install wikipedia mcp fastmcp # Check installed packages pip list | grep -E "(wikipedia|mcp|fastmcp)" ``` ### Server Operations ```bash # Start server (blocking) python mcp_server.py # Start server in background python mcp_server.py & # Stop background server pkill -f mcp_server.py ``` ### Testing & Debugging ```bash # Test Wikipedia module python -c "import wikipedia; print(wikipedia.summary('Python')[:100])" # Test MCP module python -c "from mcp.server.fastmcp import FastMCP; print('MCP working')" # Check server status ps aux | grep mcp_server ``` ## ๐Ÿ” Troubleshooting Quick Fixes | Issue | Quick Fix | |-------|-----------| | `ModuleNotFoundError: wikipedia` | `pip install wikipedia` | | `ModuleNotFoundError: mcp` | `pip install mcp fastmcp` | | Wrong Python version | `pyenv local 3.11.10` | | Virtual env not active | `source .venv311/bin/activate` | ## ๐Ÿ“ Example Usage ### Basic Wikipedia Search ```python # Tool call example { "tool": "fetch_wikipedia_info", "parameters": { "query": "Machine Learning" } } ``` ### Get Article Sections ```python # Tool call example { "tool": "list_wikipedia_sections", "parameters": { "topic": "Artificial Intelligence" } } ``` ### Read Specific Section ```python # Tool call example { "tool": "get_section_content", "parameters": { "topic": "Python (programming language)", "section_title": "History" } } ``` ## ๐ŸŽฏ Project Structure at a Glance ``` MCPClientServer/ โ”œโ”€โ”€ .venv311/ # Python 3.11 environment โ”œโ”€โ”€ src/mcp_server/ # Main server code โ”‚ โ”œโ”€โ”€ mcp_server.py # Wikipedia MCP server โ”‚ โ””โ”€โ”€ mcp_client.py # Example client โ”œโ”€โ”€ GUIDE.md # Detailed guide (this file) โ””โ”€โ”€ QUICK_REF.md # This quick reference ``` ## ๐ŸŒ MCP Integration Examples ### Claude Desktop Config ```json { "mcpServers": { "wikipedia": { "command": "python", "args": ["/path/to/mcp_server.py"] } } } ``` ### VS Code Settings ```json { "mcp.servers": { "wikipedia": { "command": "python /path/to/mcp_server.py" } } } ``` --- ๐Ÿ’ก **Tip**: Bookmark this file for quick reference while developing!

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/kaman05010/MCPClientServer'

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