MCP Connector

Execute WikiFunctions Code with AI

Wikifunctions MCP Server lets AI assistants find, template, and execute functions from Wikimedia's WikiFunctions library.

Works with wikifunctions

86
Spark score
out of 100
Updated 11 months ago
Version 1.0.0
Models
universal

Add to Favorites

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

01

Search WikiFunctions for relevant code implementations.

02

Generate JSON templates for function invocation.

03

Execute WikiFunctions with provided arguments.

04

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

find_code

Searches for a function in WikiFunctions and returns its source code implementation.

get_template

Retrieves WikiFunctions function definition and creates a JSON template for invoking it.

run_template

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. Z6 becomes "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.

  1. Finding Functions: When you use find_code or get_template, the server queries the WikiFunctions wikilambdasearch_functions API endpoint to find functions matching your search query.
  2. Fetching Details: Once a function is identified by its ZID (e.g., Z804 for "add"), the server uses the wikilambda_fetch action to get detailed information, including argument definitions, implementations, and multilingual labels.
  3. Building Templates: The get_template tool 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., Z6 becomes "String").
  4. Executing Functions: The run_template tool takes a template and user-provided values, transforms them into a valid WikiFunctions function call object, and sends it to the wikifunctions_run API 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.