Jawafdehi MCP Server
OfficialThis server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Jawafdehi MCP Server
This repository is deprecated and no longer maintained.
The Jawafdehi MCP server is now hosted at https://api.jawafdehi.org/mcp. You no longer need to install, host, or configure anything — point your MCP client at that URL and sign in with your own Jawafdehi account. See Migrating to the hosted endpoint below.
Migrating to the hosted endpoint
Claude Code
claude mcp add --transport http jawafdehi https://api.jawafdehi.org/mcp \
--client-id 380811001584419184 -s userThen start Claude Code, run /mcp, select jawafdehi, and choose Authenticate.
Confirm it worked by running the get_current_user tool — you want "authenticated": true with your name and roles. If it reports false you are on the anonymous read-only catalog, and the write tools (creating and patching cases, uploading materials) will silently be unavailable.
On a machine with no browser, use claude mcp login jawafdehi --no-browser instead. It prints a URL to open elsewhere; the callback to localhost will fail, which is expected — paste that failed URL back into the terminal.
Other MCP clients
Use the streamable-HTTP transport against https://api.jawafdehi.org/mcp. OAuth discovery is at /.well-known/oauth-protected-resource/mcp and the authorization server is https://auth.jawafdehi.org.
Why this changed
The standalone server was folded into the platform on 2026-08-05, and https://api.jawafdehi.org/mcp became the canonical address on 2026-08-11. The hosted endpoint authenticates every caller individually, so the tools you get follow your own Jawafdehi roles rather than a shared token.
The static JAWAFDEHI_API_TOKEN flow documented below no longer works: static API tokens have been retired platform-wide in favour of per-person OIDC login.
Everything below this point is retained for historical reference.
Model Context Protocol (MCP) server providing tools for integrating LLM workflows with Jawafdehi products, including Jawafdehi.org, Nepal Entity Service (NES), Nepal Government Modernization (NGM), and MarkItDown-based document conversion with the likhit plugin.
Related MCP server: CourtListener MCP Server
Available MCP Tools
Modular tool architecture for easy extension
Unified document converter powered by MarkItDown with plugin support
Read-only access with query validation
Timeout protection (default 15s)
Comprehensive error handling
Jawafdehi.org
search_jawafdehi_cases: Search published Jawafdehi accountability casesget_jawafdehi_case: Retrieve detailed case informationcreate_jawafdehi_case: Create a draft Jawafdehi casepatch_jawafdehi_case: Patch an existing case with RFC 6902 JSON Patch operations
Nepal Entity Service (NES)
submit_nes_change: Write an NES entity directly —CREATE(POST a JSON-LD document) orUPDATE(PATCH by ref with RFC 6902 ops)search_nes_entities: Search Nepal Entity Service for persons and organizationsget_nes_entities: Retrieve complete entity profilesget_nes_entity_prefixes: Fetch valid NES entity prefixes for creation/classificationget_nes_tags: Fetch all available entity tags
Materials
upload_material_file: Attach a file to a Material (/material/{source}/{ident}), uploading it to storage as a roled MediaObject
Nepal Government Modernization (NGM)
ngm_query_judicial: Execute SELECT queries against the court tables via the gated SQL planengm_extract_case_data: Extract complete judicial case information to Markdown
Likhit and Document Conversion
convert_to_markdown: Convert documents through MarkItDown with plugins enabled by default; thelikhitplugin adds Nepal-specific handling for supported PDFs and legacy.docfiles. Legacy.docfiles requireantiwordinstalled on the host (see System Requirements). Markdown is returned directly by default, or written to a file whenoutput_pathis providedconvert_date: Convert dates between AD and BS calendars
Architecture
The server uses a modular tool architecture:
src/jawafdehi_mcp/
├── server.py # Main MCP server
└── tools/ # Tool implementations
├── __init__.py # Tool registry
├── base.py # BaseTool abstract class
├── ngm_judicial.py # NGM judicial query tool
└── example_tool.py # Example tool templateAdding New Tools
Create a new file in
src/jawafdehi_mcp/tools/(e.g.,my_tool.py)Subclass
BaseTooland implement required methods:name: Tool identifierdescription: Tool descriptioninput_schema: JSON schema for inputsexecute(): Tool execution logic
Import your tool in
tools/__init__.pyAdd an instance to the
TOOLSlist inserver.py
See tools/example_tool.py for a template.
System Requirements
Most functionality requires only the Python dependencies managed by uv/poetry.
Legacy .doc file conversion (when convert_to_markdown is called on a .doc file) additionally requires antiword installed on the host:
# Ubuntu / Debian
sudo apt install antiword
# macOS
brew install antiwordWithout a system antiword binary, the bundled binary inside pyantiword (MarkItDown's .doc converter) may fail with an Exec format error if it was compiled for a different CPU architecture. .docx, .pdf, and all other formats are unaffected.
Installation (legacy self-hosting — see the deprecation notice above)
These instructions describe running your own copy of the standalone server. They are kept for reference; new users should use
https://api.jawafdehi.org/mcpinstead.
Install via PyPI (recommended):
uv tool install jawafdehi-mcpIf you want the latest unreleased changes, install from GitHub instead:
uv tool install git+https://github.com/Jawafdehi/jawafdehi-mcp.gitConfiguration (legacy)
Static API tokens no longer work.
JAWAFDEHI_API_TOKENmust be an OIDC JWT; the old static DRF tokens are rejected platform-wide. Use the hosted endpoint athttps://api.jawafdehi.org/mcp, which handles login for you.
Set the required environment variables:
export JAWAFDEHI_API_BASE_URL="https://api.jawafdehi.org"
export JAWAFDEHI_API_TOKEN="your-jawafdehi-api-token"For access questions, contact inquiry@jawafdehi.org or WhatsApp: +1 206-530-9098.
Usage
As MCP Server
Add to your MCP client configuration:
{
"mcpServers": {
"jawafdehi": {
"command": "uvx",
"args": ["jawafdehi-mcp"],
"env": {
"JAWAFDEHI_API_BASE_URL": "https://api.jawafdehi.org",
"JAWAFDEHI_API_TOKEN": "your-jawafdehi-api-token"
}
}
}
}Jawafdehi Case Drafting and Patching
Use create_jawafdehi_case to create draft cases and patch_jawafdehi_case to apply
JSON Patch updates to existing cases by case_id.
Both tools require JAWAFDEHI_API_TOKEN.
NES Entity Writes
The submit_nes_change tool writes NES entities directly on the unified entity
plane (the old NES queue endpoint and its ADD_NAME/CREATE_ENTITY/
UPDATE_ENTITY actions are gone):
action=CREATE→POST /api/entitieswith a JSON-LDdocument.action=UPDATE→PATCH /api/entities/{ref}with RFC 6902patch_ops(adding a name is just anaddop to/name).
The tool uses JAWAFDEHI_API_BASE_URL for the API host and requires
JAWAFDEHI_API_TOKEN (or a forwarded OIDC bearer) for authentication.
NES Schema Discovery
Use get_nes_entity_prefixes to fetch the currently valid NES entity prefixes.
All entity reads (search_nes_entities, get_nes_entities → /api/entities,
get_nes_tags → /api/entities/tags, get_nes_entity_prefixes →
/api/entity_prefixes) now hit the ONE unified Jawafdehi host — the standalone
nes.jawafdehi.org service and its /api/nes prefix were retired.
Available Tables
The following court tables are accessible through the gated SQL plane (/api/query/):
courts- Court master table (district, high, supreme, special courts)court_cases- Court case metadata and registration informationcourt_case_hearings- Hearing records for each casecourt_case_entities- Plaintiff and defendant information
Note: The scraped_dates table is excluded from queries.
Documentation
Architecture Overview - System design and structure
Adding Tools Guide - How to add new tools
Publishing Guide - How to release a new version to PyPI
Development
Adding New Tools
See docs/ADDING_TOOLS.md for a complete guide on adding new tools to the server.
Running Tests
poetry run pytestLinting
./scripts/format.sh --checkFormatting
poetry run black src/ tests/
poetry run isort src/ tests/License
Licensed under the Hippocratic License 3.0, an Ethical Source license. See LICENSING.md for details.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Search U.S. case law, fetch opinions, and ask matter-aware legal questions over your documents.
Resolve, search and verify legal citations against the official sources, with provenance.
Search case law and legislation and work with accessible matters and documents in stella.
Manage tickets, run agents and workflows, query tables, and search workspace knowledge.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables US case law search, citation parsing, practice management via Clio, and federal court filings through PACER.-
- FlicenseNot gradedqualityBmaintenanceEnables LLM-friendly access to the CourtListener legal database and eCFR for searching legal opinions, court cases, judges, documents, and federal regulations.15-
- AlicenseAqualityCmaintenanceExposes tools to query the Zyta API for legal data (judicial, jurisprudence, trademarks, Minerva) and supports document generation via natural language.1419 npmMIT
- AlicenseAqualityDmaintenanceConnects LLMs to the EcourtsIndia Partner API for searching Indian court cases, retrieving orders, reading cause lists, and accessing AI summaries.9MIT