IP Contingency MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@IP Contingency MCP Server Analyze ownership gaps for our China patents"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
IP Contingency MCP Server
A Model Context Protocol server that exposes 8 LLM-powered tools for IP assignment compliance analysis. It finds gaps where a patent or trademark lacks a signed assignment from the person who created it, and explains what to do about them.
It runs two ways:
As an MCP server over stdio, built on the official
@modelcontextprotocol/sdk. Claude Desktop, MCP Inspector or any MCP client can list and call the tools.As a library.
processTool()runs a tool in-process. The IP Contingency Tracker app uses it this way.
Tools
Tool | What it does | Input |
| Patterns, root causes and risk areas across many gaps |
|
| Priority, next steps, timeline and jurisdiction notes for one gap |
|
| Unusual delays, deviations, violations and risk spikes, with evidence |
|
| Executive advisory report with prioritised action items |
|
| 1-100 priority score, urgency factors and resolution time per gap |
|
| Turns a natural-language question into filters and returns matching gaps |
|
| Checks one gap against its jurisdiction's assignment rules |
|
| Predicts the resolution outcome, with confidence and weighted factors |
|
Every tool has a Zod input schema (src/schemas/index.ts). The MCP server publishes these as JSON Schema in tools/list and validates tools/call arguments against them before anything reaches the LLM.
Related MCP server: AI Compliance Calendar MCP Server
Architecture
flowchart LR
subgraph Clients
A[Claude Desktop]
B[MCP Inspector]
C[Tracker app<br/>library import]
end
A -- "JSON-RPC over stdio" --> S
B -- "JSON-RPC over stdio" --> S
S["MCP server<br/>src/server.ts<br/>tools/list · tools/call<br/>Zod input validation"] --> P
C -- "processTool()" --> P
P["processTool<br/>usage + latency tracking"] --> T["8 tools<br/>src/tools/*"]
T --> L["LLM client<br/>structured output<br/>Zod validation + 1 retry"]
L -- "Messages API<br/>output_config.format" --> M[(Claude)]src/
├── server.ts # MCP entry point: McpServer + StdioServerTransport
├── index.ts # Library entry point: processTool(), getToolDescriptions()
├── mcp/
│ ├── create-server.ts # Registers the 8 tools on an McpServer
│ └── tool-definitions.ts # Name, title, description and input schema for each tool
├── schemas/ # Zod schemas for tool inputs and LLM outputs
├── tools/ # The 8 tool implementations
├── prompts/ # System prompt for each tool
├── utils/
│ ├── llm-client.ts # Anthropic SDK wrapper (structured output, retries, usage logging)
│ ├── usage.ts # Per-tool-call token and latency accounting
│ └── logger.ts # pino logger; writes to stderr so stdout stays free for MCP
└── types/ # Shared TypeScript typesStructured output
Each tool that needs JSON back from the model passes a Zod schema to callLLMJSON():
The schema is sent as
output_config.formatthrough the SDK'smessages.parse()andzodOutputFormat(). The API then constrains the model to JSON that matches it.The parsed result is validated again with the same Zod schema.
If validation fails, the call is retried once with the validation error in the prompt. A second failure returns an
LLM_RESPONSE_INVALIDerror instead of malformed data.
Responses cut off at max_tokens, and refusals, are also reported as errors. This replaces the earlier approach of pulling the first {...} out of free text with a regex. That approach broke on tools that return arrays (detectAnomalies), and generateAdvisory split its sections with a regex. Both now use schemas.
Token usage and latency
Every LLM call logs inputTokens, outputTokens, latencyMs, model and stopReason. processTool() adds up all the LLM calls one tool made (some make two, and a retry adds one) and logs a per-tool line:
{"level":30,"tool":"analyzeGaps","success":true,"durationMs":4210,"llmCalls":1,"inputTokens":1830,"outputTokens":412,"llmLatencyMs":4188,"msg":"Tool execution completed"}The same numbers are returned as usage on every ToolResponse and in the MCP structuredContent.
Setup
npm install
cp .env.example .env # add ANTHROPIC_API_KEY
npm run buildVariable | Required | Default |
| yes | |
| no |
|
| no |
|
Use with MCP Inspector
npm run build
npx @modelcontextprotocol/inspector node dist/server.jsOpen the Inspector UI, click List Tools, choose analyzeGaps and paste the gaps array from examples/sample-gaps.json.
For a quick check from the terminal, npm run smoke starts the built server over stdio and lists its tools. If ANTHROPIC_API_KEY is set, it also calls analyzeGaps on the sample data.
Use with Claude Desktop
Add the server to claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"ip-contingency": {
"command": "node",
"args": ["/absolute/path/to/ip_contingency_mcp/dist/server.js"],
"env": {
"ANTHROPIC_API_KEY": "sk-ant-..."
}
}
}
}Restart Claude Desktop. The 8 tools appear under the tools menu. Paste gap data into the chat and ask, for example, "Rank these gaps and tell me which to fix first."
The package also declares a bin entry, so after npm install -g (or npm link) the command is just ip-contingency-mcp.
Use as a library
import { processTool } from "ip-contingency-mcp";
const result = await processTool({ tool: "analyzeGaps", input: { gaps } });
if (result.success) {
console.log(result.data); // AnalysisResult
console.log(result.usage); // { llmCalls, inputTokens, outputTokens, llmLatencyMs, durationMs }
}To embed the MCP server in another process, use createMcpServer() from ip-contingency-mcp/mcp and connect any MCP transport.
Tests
npm test # unit + in-process MCP integration tests (no API key needed)
npm run type-check
npm run smoke # real stdio round trip against dist/server.jssrc/mcp/__tests__/server.test.tsstarts the server in-process over an in-memory transport. It checks thattools/listreturns all 8 tools with schemas, runsanalyzeGapsthroughtools/callwith the LLM client mocked, and checks that invalid arguments are rejected before any LLM call.src/utils/__tests__/llm-client.test.tscovers structured-output validation, the single retry,max_tokenshandling and usage accounting.src/tools/__tests__/tools.test.tsruns individual tools against a mocked LLM.
Notes
dist/ is committed on purpose. The tracker installs this package as a git dependency (github:nakulk02/ip_contingency_mcp), and npm doesn't run build scripts for git dependencies by default. Run npm run build and commit dist/ with any source change.
Available Tools
8 toolsanalyzeGapsAnalyze IP gapsARead-only
Find patterns, root causes and risk areas across a set of IP assignment gaps (missing invention or trademark assignments). Use for portfolio-wide questions such as 'what is going wrong overall?'.
Inputs: gaps (required).
checkComplianceCheck jurisdiction complianceBRead-only
Check one gap against the IP assignment requirements of its jurisdiction and return compliance status, severity, issues and recommendations.
Inputs: gap (required).
detectAnomaliesDetect anomaliesBRead-only
Flag unusual delays, pattern deviations, compliance violations and risk spikes in a set of gaps, each with evidence and a suggested action.
Inputs: gaps (required), context.
generateAdvisoryGenerate executive advisoryBRead-only
Write an executive advisory report (summary, risk narrative, prioritised action items, timeline, financial impact) for a set of gaps.
Inputs: gaps (required), companyContext.
predictRiskPredict resolution riskBRead-only
Predict whether one gap is likely to be resolved, at risk, or likely to fail, with a confidence score and weighted factors.
Inputs: gap (required), historicalContext.
queryAssignmentsQuery gaps in natural languageBRead-only
Translate a natural-language question (e.g. 'former contractors with high-risk Chinese patents') into filters and return the matching gaps.
Inputs: gaps (required), question (required).
rankPrioritiesRank gaps by priorityARead-only
Rank gaps by strategic priority (legal urgency, financial impact, deadline proximity, complexity), returning a 1-100 score, urgency factors and an estimated resolution time for each.
Inputs: gaps (required).
recommendActionsRecommend actions for a gapBRead-only
Produce a priority, concrete next steps, a timeline and jurisdiction notes for resolving one specific IP assignment gap.
Inputs: gap (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
The single-gap tools (checkCompliance, predictRisk) are distinct from the set-level tools, but the set-level analytical tools overlap heavily: analyzeGaps, detectAnomalies, rankPriorities, generateAdvisory and recommendActions all consume 'a set of gaps' and emit risk assessments with prioritized actions and timelines. generateAdvisory in particular duplicates recommendActions (action items + timeline) and rankPriorities (priority ordering), so an agent must read descriptions carefully to pick correctly.
Every tool follows a consistent camelCase verb_noun/verb_object pattern (analyzeGaps, detectAnomalies, queryAssignments, checkCompliance) with the verb first and the object matching the domain. No style mixing or vague verbs like process/run.
Eight tools is a well-scoped size for an analysis-oriented server: two retrieval/intake tools, one gap-level check and prediction each, and four portfolio-level reporting tools. Each tool has a plausible reason to exist.
The surface is analysis-only: there is no way to fetch or inspect a single gap's raw record (only queryAssignments for sets, plus analytical views on one gap), and no create/update/close operations to remediate or track a gap once actions are recommended, which is a dead end for a lifecycle-oriented domain. The read/advise half is well covered, but the act/track half is missing.
Related MCP Connectors
AI-powered patent intelligence for search & analysis
AI inventory and EU AI Act compliance. Find AI tools and use cases, check new AI uses before launch.
AI legal compliance: contract review, risk scoring, EU/CN AI act, watermark check. 8 MCP tools.
Your GDPR register in your AI assistant: RoPA, systems, vendors, DSRs, breaches, risks.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAI-powered patent search and analysis across 220M+ global patents. Semantic search, prior art discovery, novelty/patentability reports, and patent content retrieval.Apache 2.0
- AlicenseBqualityDmaintenanceTracks AI regulations, deadlines, risk assessments, and policy updates across multiple global jurisdictions, helping users stay compliant with evolving AI laws.615 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables EU AI Act compliance for AI agent systems by providing risk classification, audit trails, gap analysis, and evidence package generation.43 npmMIT

Lightbringerofficial
AlicenseNot gradedqualityCmaintenanceEnables patent management workflows inside AI tools, allowing users to capture and refine inventions, collaborate with attorneys, and access portfolio context through natural language.MIT