Bangladesh Law MCP Server
A Model Context Protocol server that lets any AI assistant query the full text of Bangladeshi legislation directly from natural language.
README
Bangladesh Law MCP Server
A Model Context Protocol server that lets any AI assistant ā Claude, Gemini, GPT, Cursor, VS Code, Continue.dev, or any MCP-compatible client ā query the full text of Bangladeshi legislation directly from natural language.
Built on top of the Bangladesh Legal Acts Dataset, which contains 1,484+ acts scraped from http://bdlaws.minlaw.gov.bd/ and enriched with the historical government and legal-system context for each act's period.
š Credits
This project was made possible by the generous help of two friends:
- Rubaiyat ā for the early feedback, the test queries that shaped the tool surface, and the patient bug reports that turned half-broken prototypes into something that actually works end-to-end.
- Jarif ā for helping debug the stdio transport, walking through MCP-client integration on Windows, and pushing for the polished README and CI setup that make this thing actually shippable.
Thank you both ā this project exists because of you. š
And of course, thanks to sakhadib and every contributor to the original Bangladesh Legal Acts Dataset ā without that carefully curated corpus, none of this would exist.
⨠What you can ask
Once connected, your AI assistant can answer questions like:
- "Find all Bangladesh acts from the 1970s related to land."
- "What was the legal framework when the Penal Code 1860 was enacted?"
- "Show me section 3 of the Code of Criminal Procedure."
- "Which government was in power when the Bangladesh University of Professionals Act 2009 was passed?"
- "Search the entire corpus for acts that mention 'environment protection'."
- "Is the Companies Act 1994 still in force?"
š§° Tools exposed
| Tool | Purpose |
|---|---|
list_acts |
Browse acts with filters (year range, language, repealed/active, title substring) |
get_act |
Fetch a complete act by id (full sections, footnotes, government & legal context) |
get_section |
Pull a single section of an act |
search_acts |
Free-text search across titles or section bodies, with snippets |
get_statistics |
Aggregate dataset stats ā year range, language distribution, top gov systems, repealed count |
Each act is also exposed as an MCP resource at act://<act-id> so clients
that prefer resource-style reads can pull the JSON directly.
š¦ Installation
1. Clone this repo and the dataset side-by-side
git clone https://github.com/sakhadib/bangladesh-law-mcp.git
git clone https://github.com/sakhadib/Bangladesh-Legal-Acts-Dataset.git
You should now have:
bangladesh-law-mcp/
Bangladesh-Legal-Acts-Dataset/
The server will auto-discover the dataset in this sibling layout. If you keep
the dataset anywhere else, set BLA_DATA_DIR to its Data/acts folder (or to
the parent Data/ folder).
About Git LFS: the dataset uses LFS for the full corpus. If you only see a few hundred
.jsonfiles inBangladesh-Legal-Acts-Dataset/Data/acts/, rungit lfs install && git lfs pullinside the dataset repo.
2. Install Python dependencies
cd bangladesh-law-mcp
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS / Linux
source .venv/bin/activate
pip install -r requirements.txt
Or install the package itself:
pip install .
This registers a bangladesh-law-mcp command on your PATH.
3. Sanity check
python server.py
The server should print something like:
[INFO] bangladesh-law-mcp: Loading acts from .../Bangladesh-Legal-Acts-Dataset/Data/acts
[INFO] bangladesh-law-mcp: Indexing 1484 act files
[INFO] bangladesh-law-mcp: Index built: 1484 acts
and then sit silently on stdout (it's waiting for an MCP client on stdin). Press Ctrl+C to stop.
š Connect an AI client
Pick your client. All of them connect over stdio ā no API key, no network.
Claude Desktop
Edit claude_desktop_config.json:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"bangladesh-law": {
"command": "python",
"args": ["C:\\absolute\\path\\to\\bangladesh-law-mcp\\server.py"]
}
}
}
Restart Claude Desktop. You'll see a šØ icon with the new tools in the chat composer.
VS Code / Cursor (one-click via .vscode/mcp.json)
A starter config is included at .vscode/mcp.json (edit the absolute path
to match your machine):
{
"servers": {
"bangladesh-law": {
"type": "stdio",
"command": "python",
"args": ["C:\\absolute\\path\\to\\bangladesh-law-mcp\\server.py"]
}
}
}
Then in VS Code run MCP: List Servers from the command palette and start
bangladesh-law.
Gemini (via an MCP-compatible adapter)
Gemini itself doesn't speak MCP natively, but open-source MCP bridges (LangChain's MCP adapter, the MCP Inspector, etc.) let you expose MCP tools to Gemini. After installing such an adapter, point it at:
python /absolute/path/to/bangladesh-law-mcp/server.py
GPT / ChatGPT (via MCP plugin / LangChain)
Same story ā wire the stdio server into any MCP-aware orchestrator
(LangChain's MCPAdapter, AutoGen, CrewAI, etc.). The tool surface described
above is what your GPT agent will see.
Continue.dev / Cline / Roo Code
Add to your MCP config:
{
"mcpServers": [
{
"name": "bangladesh-law",
"command": "python",
"args": ["/absolute/path/to/bangladesh-law-mcp/server.py"]
}
]
}
š Live Hosted Instance (Fly.io)
The server is deployed as an always-on Streamable HTTP endpoint on Fly.io. Any MCP client that supports remote servers can connect to:
https://bangladesh-law-mcp.fly.dev/mcp
A liveness check is available at:
https://bangladesh-law-mcp.fly.dev/healthz
Connecting a remote-capable client
VS Code / Cursor (Streamable HTTP):
{
"servers": {
"bangladesh-law": {
"type": "streamableHttp",
"url": "https://bangladesh-law-mcp.fly.dev/mcp"
}
}
}
Claude Desktop (if/when remote MCP is supported):
{
"mcpServers": {
"bangladesh-law": {
"type": "streamableHttp",
"url": "https://bangladesh-law-mcp.fly.dev/mcp"
}
}
}
Note: Most desktop MCP clients today only support
stdio. The hosted endpoint is primarily for web-based agents, custom integrations, and future clients that support remote MCP. For local use, the stdio transport (above) remains the simplest option.
Deploying your own instance
-
Install flyctl and sign up.
-
Push this repo to GitHub.
-
Create a Fly app:
fly launch --no-deploy # generates fly.toml, uses the Dockerfile -
Deploy:
fly deploy --remote-only -
(Optional) Set up auto-deploy on push ā add a
FLY_API_TOKENGitHub secret (created withfly tokens create deploy) and the included.github/workflows/deploy.ymlwill deploy on every push tomain.
āļø Configuration
| Env var | Default | Purpose |
|---|---|---|
BLA_DATA_DIR |
<repo>/../Bangladesh-Legal-Acts-Dataset/Data/acts (or sibling) |
Where to find the act JSON files. Accepts the acts/ folder or its parent Data/ folder. |
BLA_LOG_LEVEL |
INFO |
One of DEBUG, INFO, WARNING, ERROR. Logs go to stderr so the stdio JSON-RPC stream stays clean. |
TRANSPORT |
stdio |
stdio for local clients, http for hosted/Streamable-HTTP mode (Fly.io, Docker). |
HOST / PORT |
0.0.0.0 / 8000 |
Bind address and port for the HTTP transport. |
š Development
Run a one-liner smoke test (no client needed):
python -c "import asyncio, server
async def m():
out = await server.mcp.call_tool('get_statistics', {})
print(out[1])
asyncio.run(m())"
Lint:
pyflakes server.py
The included GitHub Actions workflow (.github/workflows/ci.yml) lints and
byte-compiles on Python 3.10, 3.11, and 3.12 for every push and PR.
š Project layout
bangladesh-law-mcp/
āāā .dockerignore
āāā .github/
ā āāā ISSUE_TEMPLATE/
ā ā āāā bug_report.md
ā ā āāā feature_request.md
ā āāā workflows/
ā āāā ci.yml
ā āāā deploy.yml # auto-deploy to Fly.io
āāā .gitignore
āāā Dockerfile # multi-stage build (clones dataset with LFS)
āāā LICENSE
āāā README.md
āāā SECURITY.md
āāā fly.toml # Fly.io app config (always-on free tier)
āāā pyproject.toml
āāā requirements.txt
āāā server.py # the entire MCP server
š Thanks
The full credit list lives at the top of this README in the š Credits section ā please scroll up.
š License
- The server code in this repository is released under the MIT License.
- The underlying data is from sakhadib/Bangladesh-Legal-Acts-Dataset and is licensed under CC BY 4.0. Please attribute the original authors when reusing the data.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.