Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 966 Bytes

File metadata and controls

35 lines (25 loc) · 966 Bytes

MCP CKAN Plugin Example

This is an example of a MCP CKAN Plugin that register tools to answer data based on Open Data.

How to create a MCP Plugin

  1. Init a package repository:
uv init --package mcp-ckan-exampleplugin
  1. Define a register_tools(mcp) function that register tools in a MCP Server:
def register_tools(mcp):
    @mcp.tool()
    def greetings_from_examplepythontools():
        return "Hello from mcp_ckan_examplepythontools!"
  1. Register a new mcp_ckan entrypoint in the pyproject.toml file that calls the register_tools function.
[project.entry-points."mcp_ckan"]
mcp-ckan-examplepythontools = "mcp_ckan_examplepythontools:register_tools"
  1. Install it in the same virtual environment as your server.
uv pip install "git+https://github.com/okfn/mcp-ckan"
uv pip install "git+https://github.com/okfn/mcp-ckan-examplepythontools"
uv run mcp-ckan