mattergate
A self-hostable MCP permissions gateway for legal-tech systems that connects legal apps once and exposes only the tools each team member should use, enforcing a thin policy and audit layer over vendor APIs.
README
Mattergate
A self-hostable MCP permissions gateway for legal-tech systems.
The goal is simple: connect legal apps once, then expose only the MCP tools each team member should actually use. Mattergate is not a data lake. It is a thin policy and audit layer over vendor APIs.
Current status
This is a scaffold. It includes:
- TypeScript npm workspace project
- Policy engine with job-title presets and deny precedence
- Connector SDK with a mock legal connector
- MCP gateway core that filters visible tools and enforces permissions on invocation
- Minimal HTTP server and CLI placeholders
- Lightweight admin UI scaffold
- Public landing page app for the open-source project
- Research and planning docs
Real Lawmatics/Filevine/Clio/MyCase/etc. connectors come later.
Why this exists
Legal-tech APIs are inconsistent. Some vendors enforce the authenticated user's in-app permissions. Others expose broad account-level API access, weak scopes, service-account access, or docs that are silent. Lawmatics is the clearest reason to build a policy gateway: its public OAuth docs state that it does not support scopes and authorization grants full CRUD access to the account.
Quick start
npm install
npm run verify
npm run dev:server
In another shell:
curl http://127.0.0.1:4317/health
curl -H 'x-legal-mcp-user-id: demo-paralegal' http://127.0.0.1:4317/tools
Admin UI scaffold:
npm run dev:admin
Public landing page:
npm run dev:landing
Repository layout
apps/
server/ Minimal HTTP gateway API scaffold
cli/ Local stdio/CLI scaffold
admin/ Lightweight admin UI scaffold
landing/ Public open-source project landing page
packages/
core/ Shared domain types, errors, audit helpers, external-content labels
policy/ RBAC/ABAC evaluator and job-title presets
connectors/ Connector SDK and mock legal connector
mcp/ Tool filtering and policy-enforced invocation core
docs/
architecture.md
connector-development.md
deployment.md
policy-model.md
project-plan.md
project-tracker.md
research/ Ignored local research markdown files
Security posture
- Bring-your-own vendor OAuth app/client credentials. Do not ship shared client secrets.
- Encrypt OAuth refresh tokens, API keys, and vendor client secrets before any real connector work.
- Hide tools a user cannot invoke, but also enforce permission checks on every invocation.
- Default writes to dry-run where possible.
- Label external vendor content as untrusted data.
- Audit metadata, not raw legal content.
License
MIT.
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.
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.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.