mcp
Refunc Model Context Protocol Server
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
- 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
- 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
- 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
- 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:
- The demo MCP SSE endpoint is exposed at a URL like http://127.0.0.1:8001/refunc-system/mcp-demo/test/mcp-demo/sse
- The Refunc MCP SSE URL path format is /namespace/<token-secret-name>/<token>/<func-name>/sse
- 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
trpc-agent-go
trpc-agent-go is a powerful Go framework for building intelligent agent systems using large language models (LLMs) and tools.
station
Station is our open-source runtime that lets teams deploy agents on their own infrastructure with full control.
tiger-cli
Tiger CLI is the command-line interface for Tiger Cloud. It includes an MCP server for helping coding agents write production-level Postgres code.
gopls
MCP server for golang projects development: Expand AI Code Agent ability boundary to have a semantic understanding and determinisic information for golang projects.
kubernetes
A Model Context Protocol (MCP) server for the Kubernetes API.
gcp-cost
💰 An MCP server that enables AI assistants to estimate Google Cloud costs, powered by Cloud Billing Catalog API and built with Genkit for Go