This is an MCP (Model Context Protocol) server that provides access to the Wolfram Alpha LLM API, enabling AI assistants to query Wolfram Alpha for scientific and factual information.
- Query Wolfram Alpha's LLM API for scientific and factual information
- Asynchronous operation using anyio for better performance
- Easy integration with MCP-compatible AI assistants
- Python 3.8 or higher
- A Wolfram Alpha App ID (free to obtain at wolframalpha.com)
-
Clone this repository:
git clone https://github.com/bgreene2/wolfram-alpha-mcp-server.git cd wolfram-alpha-mcp-server -
Install the required dependencies:
pip install -r requirements.txt
The server requires a Wolfram Alpha App ID to function. You can obtain one by:
- Visiting wolframalpha.com
- Creating a free account or signing in
- Generating an App ID for the LLM API
Once you have your App ID, you'll need to set it as an environment variable.
Run the server with your Wolfram Alpha App ID:
WOLFRAM_APP_ID=your_app_id_here python server.pyTo use this server with an MCP-compatible client, add the following to your MCP configuration:
{
"mcpServers": {
"wolfram-alpha": {
"command": "python",
"args": [
"/path/to/server.py"
],
"env": {
"WOLFRAM_APP_ID": "YOUR_APP_ID"
}
}
}
}Replace /path/to/server.py with the actual path to your server.py file and YOUR_APP_ID with your actual Wolfram Alpha App ID.
The server exposes a single tool:
wolfram_alpha_query(query: str): Sends a query to the Wolfram Alpha LLM API and returns the result
When an AI assistant calls this tool, the server will:
- Take the query string
- Send it to Wolfram Alpha's LLM API
- Return the response to the assistant
The Wolfram Alpha LLM API is particularly good at answering:
- Scientific questions ("What is the speed of light?")
- Mathematical problems ("Solve x^2 + 2x + 1 = 0")
- Factual information ("Population of Tokyo")
- Unit conversions ("Convert 100°F to Celsius")
- Chemical data ("Molecular weight of caffeine")