The Model Context Protocol (MCP) server for logging contact events with authorities provides a structured way to track communications with different authority types. It includes rate limiting capabilities and uses Supabase for persistent storage, making it suitable for production environments.
Before installing, ensure you have:
npm install @vercel/mcp-adapter @supabase/supabase-js
Set up the following environment variables:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_anon_key
SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
Run the SQL scripts in your Supabase project to create the required tables for event logging and rate limiting.
Add the server to your MCP client configuration:
{
"mcpServers": {
"contact-authorities": {
"transport": {
"type": "http",
"url": "https://your-domain.com/api/mcp"
}
}
}
}
Use the contact_authorities
tool to log a contact event:
// Example of logging a contact event
const result = await mcpClient.contact_authorities({
title: "Suspicious Activity Report",
target: "police",
description: "Observed suspicious behavior at 123 Main St."
});
Parameters:
title
(string, required): Brief title describing the incidenttarget
(string, required): Authority target (police, fire, medical, fbi, cybercrime, local)description
(string, required): Detailed description of the contact reasonUse the get_contact_events
tool to retrieve recent events:
// Example of retrieving events
const events = await mcpClient.get_contact_events({
limit: 10,
target: "police"
});
Parameters:
limit
(number, optional): Maximum events to retrieve (default: 20, max: 100)target
(string, optional): Filter by authority targetCheck the current rate limit status:
// Example of checking rate limit status
const rateStatus = await mcpClient.get_rate_limit_status();
A user-friendly web form is available at the root URL for manual event submission. This interface allows users to:
The server implements rate limiting with the following characteristics:
If you exceed the rate limit, the server will return an appropriate error response.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.