Execute WikiFunctions Code with AI
Wikifunctions MCP Server lets AI assistants find, template, and execute functions from Wikimedia's WikiFunctions library.
Why it matters
Empower AI models to discover, understand, and execute functions from the WikiFunctions library. Seamlessly integrate with MCP-compatible tools to generate, test, and run code.
Outcomes
What it gets done
Search WikiFunctions for relevant code implementations.
Generate JSON templates for function invocation.
Execute WikiFunctions with provided arguments.
Retrieve function definitions and source code.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-wikifunctions | bash Capabilities
Tools your agent gets
Searches for a function in WikiFunctions and returns its source code implementation.
Retrieves WikiFunctions function definition and creates a JSON template for invoking it.
Executes a function call in WikiFunctions using provided template and argument values.
Overview
Wikifunctions MCP Server
Wikifunctions MCP Server lets an AI assistant search WikiFunctions for existing functions, inspect their source and argument types, build a call template, and execute the function via the WikiFunctions API. Use it when a task can reuse an existing community-maintained WikiFunctions function instead of writing new code; execution depends on WikiFunctions' own API availability.
What it does
Wikifunctions MCP Server connects an AI assistant to WikiFunctions, the Wikimedia project for creating, curating, and sharing code, letting the assistant discover and execute functions from that shared library. It queries the WikiFunctions wikilambdasearch_functions API to find matching functions, fetches full function details via wikilambda_fetch (including argument definitions and multilingual labels), builds a human-readable call template, and executes the function through the wikifunctions_run API endpoint.
When to use - and when NOT to
Use this when you want an assistant to look up, understand, or actually run a community-maintained function from WikiFunctions - for example finding how a function like "add" (ZID Z804) is implemented, or building and executing a call to it with specific argument values. It's useful for leveraging existing shared logic rather than reimplementing it. It is not useful for functions that don't exist in the WikiFunctions library, and every execution depends on WikiFunctions' own API availability and the function's published implementation.
Capabilities
find_code: searches WikiFunctions for a function matching a query and returns its source code implementation.get_template: fetches a function's definition and builds a JSON call template with its name, description, and required arguments (with types resolved to human-readable names, e.g.Z6becomes "String").run_template: executes a function call using a template and provided argument values, transforming it into the required API format and returning the result.
How to install
Add the server to your mcp.json configuration for Claude Desktop, Cursor, or another MCP-compatible client:
{
"mcpServers": {
"wikifunctions": {
"command": "npx",
"args": ["-y", "fredibau-wikifunctions-mcp"]
}
}
}
Who it's for
Developers and researchers who want an AI assistant to discover and reuse community-shared functions from WikiFunctions - inspecting how they work and executing them directly - instead of reimplementing common logic from scratch.
Source README
WikiFunctions MCP Server
This project is a Model Context Protocol (MCP) server designed to interact with WikiFunctions, a Wikimedia project for creating, curating, and sharing code.
This server exposes the functionality of WikiFunctions through the Model Context Protocol, allowing AI models and other tools to discover and execute functions from the WikiFunctions library.
Quick Start
For MCP-compatible tools like Claude-Desktop or Cursor, you can enable this server by simply adding it to your mcp.json configuration file.
{
"mcpServers": {
"wikifunctions": {
"command": "npx",
"args": ["-y", "fredibau-wikifunctions-mcp"]
}
}
}
Features
The server provides three main tools:
find_code: Searches for a function on WikiFunctions and returns its source code implementation. This is useful for inspection and understanding how a function works.get_template: Fetches the definition of a WikiFunctions function and builds a JSON template for calling it. This template includes the function's name, description, and required arguments with their types.run_template: Executes a function call on WikiFunctions using a provided template and argument values. It transforms the user-friendly template into the required format, makes the API call, and returns the result.
How It Works
The server communicates with the WikiFunctions API to perform its operations.
- Finding Functions: When you use
find_codeorget_template, the server queries the WikiFunctionswikilambdasearch_functionsAPI endpoint to find functions matching your search query. - Fetching Details: Once a function is identified by its ZID (e.g.,
Z804for "add"), the server uses thewikilambda_fetchaction to get detailed information, including argument definitions, implementations, and multilingual labels. - Building Templates: The
get_templatetool parses the function details to construct a user-friendly JSON object that describes how to call the function. It resolves type ZIDs to human-readable names (e.g.,Z6becomes "String"). - Executing Functions: The
run_templatetool takes a template and user-provided values, transforms them into a valid WikiFunctions function call object, and sends it to thewikifunctions_runAPI endpoint for execution. The result is then parsed and returned.
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.