Skip to content

ReactiveBayes/rxinfer-fastmcp-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RxInfer FastMCP Example

An MCP server that exposes Bayesian house price estimation powered by RxInfer.jl. Point it at a CSV of housing data, and it learns a probabilistic pricing model that predicts prices with honest uncertainty -- when information is missing, the model says "I'm less sure" instead of silently guessing.

Built with FastMCP, JuliaCall, and uv.

Tools

Tool Description
run_bayesian_analysis Load a CSV file and train the Bayesian regression model
describe_data Inspect the loaded dataset -- columns, stats, and what the model recognizes
estimate_house_price Predict price for a house (any features can be omitted)

The CSV should have a price column and any of: bedrooms, bathrooms, living_area, floors, basement_area, yr_built, label.

Installation

uv sync

Julia dependencies are managed automatically by juliapkg. If you hit issues, see the juliapkg docs.

Usage

Start the server in the background before connecting any MCP client:

uv run fastmcp run main.py:mcp --transport sse --port 8001

The first startup is slow (~30s) because Julia compiles packages and generates a test CSV. Subsequent runs use the compiled cache and start much faster. Wait until you see the server listening message before proceeding.

Pluto Notebook

The Bayesian model is developed in example.jl, a Pluto.jl reactive notebook. To explore or modify the model interactively, install Pluto following the instructions on the website, then open the notebook:

using Pluto; Pluto.run()

This opens a browser-based environment where you can open example.jl, tweak the model, and see results update in real time.

Claude Desktop

To connect via SSE in Claude Desktop, add the following to your Claude Desktop MCP configuration:

{
  "mcpServers": {
    "rxinfer": {
      "command": "npx",
      "args": [
        "mcp-remote@latest",
        "http://localhost:8001/sse"
      ]
    }
  }
}

Make sure the server is running before launching Claude Desktop.

Claude Code

A .mcp.json is included that connects to the server on localhost:8001. Start the server first in a separate terminal:

uv run fastmcp run main.py:mcp --transport sse --port 8001

Then launch Claude Code in the project directory. The server will be detected automatically — approve it when prompted.

Example conversation

Ask Claude to run Bayesian analysis on the test dataset (created automatically when starting the server)

Screenshot 2026-03-26 at 11 20 36

Prompt it to estimate a price for some house, some features might be missing

Screenshot 2026-03-26 at 11 20 22

Think of the situation where you actually got the missing data about the previously unknown features and check the new result

Screenshot 2026-03-26 at 11 01 23

About

A simple example to demonstrate how to call RxInfer from Python's code and return the result to an LLM with MCP protocolg2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors