Agentation MCP Server

1.2.0 · active · verified Tue Apr 21

Agentation MCP (Model Context Protocol) is a Node.js server designed to provide visual feedback to AI coding agents, such as Claude Code. It facilitates a two-way communication channel where a browser toolbar can send web page annotations to the server, and AI agents can consume these annotations as actionable feedback. The server exposes both an HTTP API for browser interaction (e.g., creating sessions, adding annotations) and an MCP interface (via stdio) to AI agents, offering tools to list, retrieve, acknowledge, resolve, and dismiss annotations. It also supports 'hands-free mode' for continuous agent processing via a `watch_annotations` tool. Currently at version 1.2.0, the package primarily focuses on CLI-driven server operation but ships with TypeScript types, implying programmatic integration is possible. Its key differentiator is providing a structured, visual feedback loop specifically for AI agents interacting with web content.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to programmatically start the Agentation MCP server, configuring its port and other options via environment variables, and includes basic signal handling for graceful shutdown.

import { startServer, type ServerOptions } from 'agentation-mcp';

const serverOptions: ServerOptions = {
  port: parseInt(process.env.AGENTATION_PORT ?? '4747', 10),
  mcpOnly: process.env.AGENTATION_MCP_ONLY === 'true',
  httpUrl: process.env.AGENTATION_HTTP_URL,
  // Add other environment variables for webhooks if needed
  // For example, webhookUrl: process.env.AGENTATION_WEBHOOK_URL,
  // webhooks: process.env.AGENTATION_WEBHOOKS?.split(','),
};

async function main() {
  try {
    console.log(`Starting Agentation MCP server with options:`, serverOptions);
    const server = await startServer(serverOptions);
    console.log(`Agentation MCP HTTP server listening on http://localhost:${serverOptions.port}`);
    console.log(`MCP server started (stdio interface for AI agents).`);

    // Keep the process alive, or handle graceful shutdown
    process.on('SIGINT', async () => {
      console.log('Shutting down server...');
      await server.stop(); // Assuming a `stop` method exists
      process.exit(0);
    });
    process.on('SIGTERM', async () => {
      console.log('Shutting down server...');
      await server.stop();
      process.exit(0);
    });

  } catch (error) {
    console.error('Failed to start Agentation MCP server:', error);
    process.exit(1);
  }
}

main();

view raw JSON →