FastMCP Science Demo
This FastMCP science demo server exposes two tools: generate_random_points and plot_sine_wave. generate_random_points creates a CSV file of random points with a configurable number of rows (default 30) and a seed for reproducibility (default 42). plot_sine_wave produces a PNG plot of a sine wave with a configurable number of samples (default 200, minimum 2). Both tools require an output_dir to save the generated artifacts and return a structured result containing status, file paths, a message, and optional metadata. It's a minimal starter for exposing scientific Python functions as MCP tools for agent consumption.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FastMCP Science Demogenerate 30 random points in /tmp"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Science MCP Server Starter
Minimal starter code for wrapping science functions as MCP tools.
The science code stays normal Python. The MCP wrapper only imports the public
tool functions listed in pyproject.toml and exposes them through FastMCP.
This repo only defines the MCP server. Agent code lives in the client repo that connects to it.
Connect Science Code
Copy the MCP wrapper into the science repo root.
mcp_server/This repo uses science_demo/ as the example science package.
Create normal Python functions in the science package.
def plot_sine_wave(output_dir: str, num_points: int = 200):
"""Plot a sine wave and save it in output_dir."""
...Export only the MCP tools from the science package
__init__.py.
from .science_tools import plot_sine_wave
__all__ = ["plot_sine_wave"]Only names in __all__ become MCP tools. Helper functions stay private. This
starter does not scan a repo for functions.
Add the MCP dependency and tool module config in
pyproject.toml.
dependencies = [
"mcp[cli]>=1.27,<2",
]
[tool.mcp-server]
tool_modules = ["your_science_package"]Install the science repo.
python3.12 -m venv .venv
source .venv/bin/activate
pip install -e .Connect an agent with one transport.
Use stdio for a local MCP server that the agent's MCP client starts for you.
Do not start the stdio server in a separate terminal. Configure the client with
the command and arguments to launch:
{
"science": {
"transport": "stdio",
"command": "python",
"args": ["-m", "mcp_server", "--transport", "stdio"]
}
}Use streamable-http when the agent connects to an already running server.
Start the server in a terminal:
python -m mcp_server --transport streamable-http --host 127.0.0.1 --port 8000Then point the agent at:
http://127.0.0.1:8000/mcpRelated MCP server: openclaw-tools-mcp
Demo Tools
The demo science package exposes:
generate_random_points(output_dir: str, count: int = 30, seed: int = 42) -> ArtifactResult
plot_sine_wave(output_dir: str, num_points: int = 200) -> ArtifactResultThe type hints, docstrings, and Pydantic constraints become the MCP tool schema that external agents see.
Successful artifact tools return:
{"status": "success", "files": ["..."], "message": "...", "metadata": {}}Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Alicense-qualityDmaintenanceExposes PyAutoGUI desktop automation functions as MCP tools, enabling mouse control, keyboard input, and screenshot capture.Last updated4BSD 3-Clause
- Alicense-qualityFmaintenanceExposes OpenClaw tools (web search, page fetching, browser automation, PDF analysis, messaging, inter-agent communication, Canvas) as MCP tools for ACP agents.Last updated1The Unlicense
- Alicense-qualityDmaintenanceProvides a comprehensive set of mathematical functions as MCP tools, enabling language models to perform calculations including arithmetic, trigonometry, logarithms, and more.Last updated191MIT
- AlicenseAqualityBmaintenanceEnables dynamic creation and execution of custom tools/functions in multiple programming languages at runtime, exposing them to MCP clients like Claude.Last updated41543MIT
Related MCP Connectors
Science MCP — free science data APIs
Educational MCP server with 17 math/stats tools, visualizations, and persistent workspace
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/HEP-KE/science-mcp-server-starter'
If you have feedback or need assistance with the MCP directory API, please join our Discord server