Announcing mcpwikipedia: Open source MCP server for searching Wikipedia

Repository

About

A Model Context Protocol (MCP) Server for querying Wikipedia written in Xojo.

The tool will query the Wikipedia API to find the best matching article for your query, retrieve the HTML and then convert that to Markdown. It does some processing to exclude parts of the article that are likely not helpful to a language model. Currently the tool returns the whole (processed article) so be mindful that these can be large in terms of token count.

Usage

Build the project and place the built components in the desired location on your system. I’m on a Mac and I place it in my Users folder: /Users/garry/mcp-servers/mcpwikipedia.

In your MCP client application (e.g. LM Studio, Claude Desktop, etc), follow the instructions on how to add an MCP server to the application. This usually involves editing some sort of mcp.json file.

mcpwikipedia requires a --useragent command line argument containing a name for your MCP server. This is a requirement of the Wikipedia API. It can be anything you like, just not empty.

You can also pass a --verbose flag to mcpwikipedia which will instruct it to output detailed logging to stderr.

Here is what my LM Studio mcp.json file looks like:

{
  "mcpServers": {
	"mcpwikipedia": {
	  "command": "/Users/garry/mcpservers/mcpwikipedia/mcpwikipedia",
	  "args": [
		"--useragent",
		"MyXojoMCPWikipediaSearcher"
	  ]
	}
  }
}

Once you’ve informed your MCP client about the server, you normally have to restart the client to finalise things. Once that’s done, you’re local LLM will use mcpwikipedia to search Wikipedia web using the official API.

Hopefully looking at the code will demonstrate how easy it is to build your own tools to use with LLMs using Xojo.

Related

This tool utilises two of my other open source Xojo components:

MCPKit:

WikipediaKit:

4 Likes

!!!thanks a lot

i tried following your path file, i got

i don’t know what i’m doing lol

You need to pass a command line argument called --useragent with a string to the MCP tool.

If you’re debugging it, you can do this from within the IDE like this:

user agent from claude

How to Use It

When configuring your Wikipedia MCP server for LM Studio or other clients, you’d add it to the arguments:

json

{
  "mcpServers": {
    "wikipedia": {
      "command": "wikipedia-mcp",
      "args": ["--useragent=MyApp/1.0 (yourcontact@email.com)"]
    }
  }
}

Key Points

  • It’s not strictly required for all requests, but it’s strongly encouraged and considered best practice

  • Without a proper User-Agent, your requests might be rate-limited or blocked if Wikipedia detects unusual traffic patterns

  • The contact information helps Wikipedia reach you if your bot causes problems or they need to inform you about API changes

This ensures you’re being a good citizen of the Wikipedia API ecosystem while using MCP servers with LM Studio!