Integrations
Uses FastAPI to expose the Bayesian MCP server API endpoints for model creation, belief updating, prediction generation, model comparison, and visualization.
Provides installation instructions for cloning the repository from GitHub to set up the Bayesian MCP server.
Utilizes NumPy for numerical computations in Bayesian inference, handling arrays and mathematical operations for probabilistic models.
Bayesian MCP
A Model Calling Protocol (MCP) server for Bayesian reasoning, inference, and belief updating. This tool enables LLMs to perform rigorous Bayesian analysis and probabilistic reasoning.
Features
- 🧠 Bayesian Inference: Update beliefs with new evidence using MCMC sampling
- 📊 Model Comparison: Compare competing models using information criteria
- 🔮 Predictive Inference: Generate predictions with uncertainty quantification
- 📈 Visualization: Create visualizations of posterior distributions
- 🔌 MCP Integration: Seamlessly integrate with any LLM that supports MCP
Installation
Development Installation
Clone the repository and install dependencies:
Requirements
- Python 3.9+
- PyMC 5.0+
- ArviZ
- NumPy
- Matplotlib
- FastAPI
- Uvicorn
Quick Start
Starting the Server
The server will start and listen for MCP requests on the specified host and port.
API Usage
The Bayesian MCP server exposes several functions through its API:
1. Create Model
Create a new Bayesian model with specified variables.
2. Update Beliefs
Update model beliefs with new evidence.
3. Make Predictions
Generate predictions using the posterior distribution.
4. Compare Models
Compare multiple models using information criteria.
5. Create Visualization
Generate visualizations of model posterior distributions.
Examples
The examples/
directory contains several examples demonstrating how to use the Bayesian MCP server:
Linear Regression
A simple linear regression example to demonstrate parameter estimation:
A/B Testing
An example of Bayesian A/B testing for conversion rates:
Supported Distributions
The Bayesian engine supports the following distributions:
normal
: Normal (Gaussian) distributionlognormal
: Log-normal distributionbeta
: Beta distributiongamma
: Gamma distributionexponential
: Exponential distributionuniform
: Uniform distributionbernoulli
: Bernoulli distributionbinomial
: Binomial distributionpoisson
: Poisson distributiondeterministic
: Deterministic transformation
MCP Integration
This server implements the Model Calling Protocol, making it compatible with a wide range of LLMs and frameworks. To use it with your LLM:
License
MIT
Credits
Based on concepts and code from the Wrench AI framework.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A Model Calling Protocol server that enables LLMs to perform rigorous Bayesian analysis and probabilistic reasoning, including inference, model comparison, and predictive modeling with uncertainty quantification.
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that enables LLMs to analyze options chains, calculate Greeks, and evaluate basic options strategies through Yahoo Finance data.Last updated -4PythonMIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that provides basic mathematical and statistical functions to LLMs, enabling them to perform accurate numerical calculations through a simple API.Last updated -132TypeScriptMIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that enables LLMs to perform precise numerical calculations by evaluating mathematical expressions.Last updated -148PythonMIT License
- -securityFlicense-qualityEnables LLMs to perform statistical analysis and generate ML predictions on user data from databases or CSV files through a Model Context Protocol server.Last updated -Python