Wikipedia MCP server

Fetches and converts Wikipedia articles to clean Markdown format for direct reference in conversations without manual copying or formatting.
Back to servers
Provider
Spektral Development
Release date
Feb 27, 2025
Language
Python

This MCP (Model Context Protocol) server provides a wiki capability for Goose AI Agent, allowing you to extend its functionality for information retrieval and knowledge management. The server acts as a specialized extension that integrates with Goose AI to enhance its capabilities.

Installation

To get started with the MCP Wiki server, follow these steps:

Prerequisites

  • Node.js installed on your system
  • NPM (Node Package Manager)
  • A Goose AI account (for integration)

Setup Steps

  1. Clone the repository:
git clone https://github.com/username/mcp-wiki.git
cd mcp-wiki
  1. Install dependencies:
npm install
  1. Configure your environment variables by creating a .env file in the root directory:
PORT=3000
API_KEY=your_goose_ai_api_key
WIKI_SOURCE=your_wiki_data_source
  1. Start the server:
npm start

The server should now be running on http://localhost:3000 (or your specified port).

Usage

Connecting to Goose AI

To connect your MCP Wiki server to Goose AI:

  1. In your Goose AI dashboard, navigate to Extensions settings
  2. Add a new Custom Extension
  3. Enter your MCP server URL (e.g., http://localhost:3000 for local development)
  4. Provide your API key if prompted

Basic API Endpoints

The server exposes the following key endpoints:

Query the Wiki

curl -X POST http://localhost:3000/query \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your_api_key" \
  -d '{"query": "your search term"}'

Add Wiki Content

curl -X POST http://localhost:3000/content \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer your_api_key" \
  -d '{
    "title": "Article Title",
    "content": "Article content goes here",
    "tags": ["tag1", "tag2"]
  }'

Configuration Options

You can customize your MCP Wiki server by modifying the following configuration options in config.json:

{
  "maxResultsPerQuery": 5,
  "enableFullTextSearch": true,
  "cacheTimeoutMinutes": 30,
  "allowedFileTypes": ["md", "txt", "pdf"]
}

Example Integration

Here's a simple example of how to integrate the MCP Wiki with a Node.js application:

const axios = require('axios');

async function queryWiki(searchTerm) {
  try {
    const response = await axios.post('http://localhost:3000/query', {
      query: searchTerm
    }, {
      headers: {
        'Authorization': `Bearer your_api_key`,
        'Content-Type': 'application/json'
      }
    });
    
    return response.data;
  } catch (error) {
    console.error('Error querying wiki:', error);
  }
}

// Example usage
queryWiki('artificial intelligence').then(results => {
  console.log('Search results:', results);
});

Troubleshooting

Common Issues

  • Connection Refused: Verify the server is running and the port is correct
  • Authentication Failed: Check that your API key is correct in both client and server
  • No Results Found: Ensure your wiki database is populated and indexed properly

Logs

Check the server logs for more detailed error information:

npm run logs

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later