Contact Authorities MCP server

Enables AI systems to log emergency contact events with rate limiting and persistent storage using Supabase for reporting suspicious activities, cybersecurity incidents, or emergency situations.
Back to servers
Provider
Rhys Sullivan
Release date
May 25, 2025
Stats
1 star

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.

Installation

Prerequisites

Before installing, ensure you have:

  • Node.js installed
  • A Supabase account and project

Install Dependencies

npm install @vercel/mcp-adapter @supabase/supabase-js

Environment Configuration

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

Database Setup

Run the SQL scripts in your Supabase project to create the required tables for event logging and rate limiting.

Usage

MCP Client Configuration

Add the server to your MCP client configuration:

{
  "mcpServers": {
    "contact-authorities": {
      "transport": {
        "type": "http",
        "url": "https://your-domain.com/api/mcp"
      }
    }
  }
}

Available MCP Tools

Logging Contact Events

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 incident
  • target (string, required): Authority target (police, fire, medical, fbi, cybercrime, local)
  • description (string, required): Detailed description of the contact reason

Retrieving Events

Use 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 target

Checking Rate Limit Status

Check the current rate limit status:

// Example of checking rate limit status
const rateStatus = await mcpClient.get_rate_limit_status();

Web Interface

A user-friendly web form is available at the root URL for manual event submission. This interface allows users to:

  1. Select an authority target
  2. Enter a title for the event
  3. Provide a detailed description
  4. Submit the contact event

Rate Limiting

The server implements rate limiting with the following characteristics:

  • 5 requests per minute per IP address
  • Applies to both MCP API calls and web interface submissions
  • Rate limit data is stored persistently in Supabase
  • Old rate limit entries are automatically cleaned up

If you exceed the rate limit, the server will return an appropriate error response.

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later