Sponsored by Deepsite.site

Opengraph.io

创建者
securecoders6 months ago
Opengraph.io MCP Server — Instant Link Metadata Extraction An MCP server that connects clients to the Opengraph.io web API, fetching rich metadata (titles, descriptions, images, Open Graph tags, etc.) for any URL. It lets clients retrieve structured link preview data. Ideal for chat bots, UIs, and agents that need to unfurl links and display previews or analyze page metadata, using your Opengraph.io App ID. There is also a suite of image generation tools. There are both stdio & https transports available use the npx config for stdio or the url config for HTTPS
内容

OpenGraph MCP Server (og-mcp)

og‑mcp is a Model‑Context‑Protocol (MCP) server that makes every OpenGraph.io ( https://opengraph.io ) API endpoint available to AI agents (e.g. Anthropic Claude, Cursor, LangGraph) through the standard MCP interface.

Why? If you already use OpenGraph.io to unfurl links, scrape HTML, extract article text, or capture screenshots, you can now give the same capabilities to your autonomous agents without exposing raw API keys.

Global Installation

You can install this package globally via npm:

npm install -g opengraph-io-mcp

Quick Install

The easiest way to configure OpenGraph MCP for any supported client:

# Interactive mode - guides you through setup
npx opengraph-io-mcp-install

# Direct mode - specify client and app ID
npx opengraph-io-mcp-install --client cursor --app-id YOUR_APP_ID

Supported clients: cursor, claude-desktop, windsurf, vscode, zed, jetbrains

Claude Desktop Extension

For Claude Desktop users, you can also download the .mcpb extension for one-click installation from the Releases page.

Client Configuration

All configurations below use stdio transport (recommended). Replace YOUR_OPENGRAPH_APP_ID with your OpenGraph.io App ID.

Claude Desktop

Config location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "opengraph": {
      "command": "npx",
      "args": ["-y", "opengraph-io-mcp"],
      "env": {
        "APP_ID": "YOUR_OPENGRAPH_APP_ID"
      }
    }
  }
}

Claude Code

One-command installation:

# macOS/Linux
claude mcp add --transport stdio --env APP_ID=YOUR_OPENGRAPH_APP_ID opengraph -- npx -y opengraph-io-mcp

# Windows (requires cmd /c wrapper)
claude mcp add --transport stdio --env APP_ID=YOUR_OPENGRAPH_APP_ID opengraph -- cmd /c npx -y opengraph-io-mcp

Cursor

Config location: ~/.cursor/mcp.json

{
  "mcpServers": {
    "opengraph": {
      "command": "npx",
      "args": ["-y", "opengraph-io-mcp"],
      "env": {
        "APP_ID": "YOUR_OPENGRAPH_APP_ID"
      }
    }
  }
}

VS Code

Config location: .vscode/mcp.json (in your project directory)

VS Code supports input prompts for secure credential handling:

{
  "inputs": [
    {
      "type": "promptString",
      "id": "opengraph-app-id",
      "description": "OpenGraph App ID",
      "password": true
    }
  ],
  "servers": {
    "opengraph": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "opengraph-io-mcp"],
      "env": {
        "APP_ID": "${input:opengraph-app-id}"
      }
    }
  }
}

Windsurf

Config location: ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "opengraph": {
      "command": "npx",
      "args": ["-y", "opengraph-io-mcp"],
      "env": {
        "APP_ID": "YOUR_OPENGRAPH_APP_ID"
      }
    }
  }
}

JetBrains AI Assistant

Add to your JetBrains AI Assistant MCP configuration:

{
  "mcpServers": {
    "opengraph": {
      "command": "npx",
      "args": ["-y", "opengraph-io-mcp"],
      "env": {
        "APP_ID": "YOUR_OPENGRAPH_APP_ID"
      }
    }
  }
}

Zed

Config location: ~/.config/zed/settings.json

Note: Zed uses context_servers instead of mcpServers:

{
  "context_servers": {
    "opengraph": {
      "command": "npx",
      "args": ["-y", "opengraph-io-mcp"],
      "env": {
        "APP_ID": "YOUR_OPENGRAPH_APP_ID"
      }
    }
  }
}

Available Tools

OpenGraph.io Data Tools

Tool NameOpenGraph.io API EndpointDescriptionDocumentation
Get OG Data/api/1.1/site/<URL>Extracts Open Graph data from a URLOpenGraph.io Docs
Get OG Scrape Data/api/1.1/scrape/<URL>Scrapes data from a URL using OpenGraph's scrape endpointOpenGraph.io Docs
Get OG Screenshot/api/1.1/screenshot/<URL>Gets a screenshot of a webpage using OpenGraph's screenshot endpointOpenGraph.io Docs
Get OG Query/api/1.1/query/<URL>Query a site with a custom question and optional response structureOpenGraph.io Docs
Get OG Extract/api/1.1/extract/<URL>Extract specific HTML elements (h1, p, etc.) from a webpageOpenGraph.io Docs

Image Generation Tools

Tool NameDescription
Generate ImageCreate professional images: illustrations, diagrams (Mermaid/D2/Vega), icons, social cards, or QR codes
Iterate ImageRefine, modify, or create variations of existing generated images
Inspect Image SessionRetrieve session metadata and asset history for image generation sessions
Export Image AssetExport generated image assets as inline base64, with optional disk write when running locally

Image Generation

The og-mcp server includes powerful AI-driven image generation capabilities, perfect for creating social media cards, architecture diagrams, icons, and more.

Generate Image

Create images from natural language prompts or diagram code.

Supported Image Types (kind):

  • illustration - General-purpose AI-generated images
  • diagram - Technical diagrams from Mermaid, D2, or Vega syntax
  • icon - App icons and logos
  • social-card - OG images optimized for social sharing
  • qr-code - QR codes with optional styling

Preset Aspect Ratios:

  • Social: og-image, twitter-card, twitter-post, linkedin-post, facebook-post, instagram-square, instagram-portrait, instagram-story, youtube-thumbnail
  • Standard: wide, square, portrait
  • Icons: icon-small, icon-medium, icon-large

Style Presets: github-dark, github-light, notion, vercel, linear, stripe, neon-cyber, pastel, minimal-mono, corporate, startup, documentation, technical

Diagram Templates: auth-flow, oauth2-flow, crud-api, microservices, ci-cd, gitflow, database-schema, state-machine, user-journey, cloud-architecture, system-context

Example Usage:

// Generate a social card
generateImage({
  prompt: "A modern tech startup hero image with abstract geometric shapes",
  kind: "social-card",
  aspectRatio: "og-image",
  stylePreset: "vercel",
  brandColors: ["#0070F3", "#000000"]
})

// Generate a diagram from Mermaid syntax
generateImage({
  prompt: "graph TD; A[User] --> B[API]; B --> C[Database]",
  kind: "diagram",
  diagramSyntax: "mermaid",
  stylePreset: "github-dark"
})

Iterate Image

Refine or modify an existing generated image.

Use cases:

  • Edit specific parts: "change the background to blue"
  • Apply style changes: "make it more minimalist"
  • Fix issues: "remove the text", "make the icon larger"
  • Crop to specific coordinates

Example:

iterateImage({
  sessionId: "uuid-from-generate",
  assetId: "uuid-from-generate",
  prompt: "Change the primary color to #0033A0 and add a subtle drop shadow"
})

Inspect Image Session

Review session details and find asset IDs for iteration.

Returns:

  • Session metadata (creation time, name, status)
  • List of all assets with prompts, toolchains, and status
  • Parent-child relationships showing iteration history

Example:

inspectImageSession({
  sessionId: "uuid-from-generate"
})

Export Image Asset

Export a generated image asset by session and asset ID. Returns the image inline as base64 along with metadata (format, dimensions, size).

When running locally (stdio transport), you can optionally provide a destinationPath to save the image to disk. On hosted/HTTP transport, the path is ignored and the image is returned inline only.

Examples:

// Inline only (works everywhere)
exportImageAsset({
  sessionId: "uuid-from-generate",
  assetId: "uuid-from-generate"
})

// Save to disk (stdio/local only)
exportImageAsset({
  sessionId: "uuid-from-generate",
  assetId: "uuid-from-generate",
  destinationPath: "/Users/me/project/images/hero.png"
})

How it works

og-mcp Architecture Diagram Diagram generated with og-mcp's image generation tools

The og-mcp server acts as a bridge between AI clients (like Claude or other LLMs) and the OpenGraph.io API:

  1. AI client makes a tool call to one of the available MCP functions
  2. og-mcp server receives the request and formats it for the OpenGraph.io API
  3. OpenGraph.io processes the request and returns data
  4. og-mcp transforms the response into a format suitable for the AI client
  5. AI client receives the structured data ready for use

This abstraction prevents exposing API keys directly to the AI while providing full access to OpenGraph.io capabilities.

Setup and Running

  1. Clone this repository
  2. Install dependencies:
    npm install
    
  3. Build the TypeScript code:
    npm run build
    
  4. Start the server:
    npm start
    

The server will run on port 3010 by default (configurable via PORT environment variable).

Configuration

The server requires an OpenGraph.io App ID to function properly. You can provide this in several ways:

  1. Using environment variables: Set OPENGRAPH_APP_ID or APP_ID in a .env file or as an environment variable
  2. Using command-line arguments with stdio transport: --app-id YOUR_APP_ID
  3. When using SSE transport: Include it in the URL as a query parameter (?app_id=YOUR_APP_ID)

Example .env file:

OPENGRAPH_APP_ID=your_app_id_here
# or
APP_ID=your_app_id_here

Transport Options

For command-line usage and npm global installation, the server can be run with stdio transport:

npm run start:stdio

You can pass the OpenGraph API key directly via command-line argument:

npm run start:stdio -- --app-id YOUR_APP_ID

When installed globally:

opengraph-io-mcp --app-id YOUR_APP_ID

This mode allows the server to be invoked directly by other applications that use MCP.

HTTP/SSE Transport

This method runs a web server that can be accessed over HTTP and uses SSE for streaming:

npm start

HTTP/SSE Transport (Alternative)

If you prefer running a persistent server instead of stdio:

npm start

Then configure your client to connect to:

http://localhost:3010/sse?app_id=YOUR_OPENGRAPH_APP_ID

Troubleshooting

  • If tools aren't showing up, check that the server is running and the URL is correctly configured in Cursor
  • Check the server logs for any connection or authorization issues
  • Verify that Claude has been instructed to use the specific tools by name

服务器配置

{
  "mcpServers": {
    "opengraph": {
      "command": "npx",
      "args": [
        "-y",
        "opengraph-io-mcp"
      ],
      "env": {
        "OPENGRAPH_APP_ID": "YOUR_APP_ID_HERE"
      }
    },
    "opengraph-io-hosted-mcp": {
      "url": "https://mcp.opengraph.io/mcp",
      "headers": {
        "x-app-id": "YOUR_APP_ID_HERE"
      }
    }
  }
}
推荐的 MCP Server
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Serper MCP ServerA Serper MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
DeepChatYour AI Partner on Desktop
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Amap Maps高德地图官方 MCP Server
Playwright McpPlaywright MCP server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
CursorThe AI Code Editor
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Tavily Mcp
WindsurfThe new purpose-built IDE to harness magic
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
ChatWiseThe second fastest AI chatbot™
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.