Get the FREE Ultimate OpenClaw Setup Guide →

mcp

Refunc Model Context Protocol Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio refunc-mcp-server docker run -i refunc/mcp-server

How to use

This MCP server is designed to run within a Refunc-based environment and is managed via Kubernetes. The README shows how to deploy the full Refunc stack in a namespace (refunc-system), then expose services locally using kubectl port-forward so you can interact with the MCP endpoint and the overall Refunc API. The workflow includes creating a function with the refunc-cli, deploying a demo MCP function, and then configuring an MCP endpoint that maps a set of tools to a function. The MCP endpoint accepts tools (functions) and will automatically attach internal parameters such as _call_type and _call_method to each invocation, enabling multiple tools under a single MCP function. To interact with the MCP SSE endpoint, use the provided URL format to stream server-sent events for updates and results.

How to install

Prerequisites:

  • kubectl configured to access your Kubernetes cluster
  • A Kubernetes cluster (e.g., kind, minikube, or any managed cluster)
  • Optional: Docker if you plan to test locally with a docker-based server image
  • Python 3 environment for refunc-cli usage
  1. Deploy the Refunc MCP server stack:

kubectl apply -f https://raw.githubusercontent.com/refunc/mcp-server/refs/heads/main/deploy/play-all-in-one.yaml

  1. Expose services locally (optional for development):

kubectl port-forward svc/aws-api 8000:http --address 0.0.0.0 -n refunc-system kubectl port-forward svc/mcp-server 8001:http --address 0.0.0.0 -n refunc-system

  1. Install the Refunc CLI and create a sample function:

pip install -U refunc-cli mkdir mcp-demo && cd mcp-demo rfctl init

Follow prompts to configure a Python-based function (example)

Write your function code in main.py, e.g. a simple echo hello message

AWS_DEFAULT_ENDPOINT=http://127.0.0.1:8000 rfctl create

  1. Create and update an MCP endpoint configuration (as shown in the README) using rfctl:

AWS_DEFAULT_ENDPOINT=http://127.0.0.1:8000 rfctl update-config

Notes:

  1. Optional: Create your own MCP event configuration and deploy it via rfctl, following the example in the README to define tools and mappings. You can then trigger MCP events to exercise the tools defined in your function.

Additional notes

Tips and common considerations:

  • The deployed demo data is not persistent by default, as noted in the README. If you need persistence, consider persisting the underlying storage used by your Kubernetes deployment.
  • When testing MCP tools, remember that the function invocation will include two built-in parameters: _call_type and _call_method, where _call_method is the name of the selected tool.
  • The environment variable AWS_DEFAULT_ENDPOINT is used to point the Refunc API client to your local API endpoint (8000 in the examples). Ensure it matches your setup when invoking rfctl commands.
  • If you encounter CORS or networking issues, review the URL and namespace configuration in lambda.yaml and verify the port-forward mappings are active.
  • The sample configuration demonstrates a single MCP tool (echo-hello) but the event spec supports multiple tools; you can extend the list under tools to chain more capabilities.

Related MCP Servers

Sponsor this space

Reach thousands of developers