GR

Graphlit MCP Server Setup with Client Example

Configure the MCP server with Graphlit using a concise setup guide and client example to quickly integrate MCP clients.

Quick Install
npx -y @graphlit/graphlit-mcp-server

Overview

The Graphlit MCP (Model Context Protocol) Server provides a bridge between MCP-compatible clients (Cursor, Windsurf, Goose, Cline, etc.) and a Graphlit project. It turns everything you ingest into a searchable, RAG-ready knowledge base: files (PDF, DOCX, PPTX), web pages (extracted to Markdown), audio/video (transcribed), messages and issues, calendars, and more. MCP clients connect to the server to run retrieval, extraction, ingestion and publishing tools against that project.

This server is useful when you want to surface organized, contextualized knowledge into third‑party LLM frontends or tools without rebuilding ingestion and connectors. It centralizes connectors (Slack, Google Drive, GitHub, Notion, etc.), web crawling/search, and a set of MCP tools so clients can request search results, prompt conversations, extract structured JSON, publish audio/images, and more.

Features

  • Centralized MCP server that exposes Graphlit tools to MCP clients
  • Built‑in ingestion for files, web pages, messages, emails, issues, and RSS
  • Web crawling, web search, and screenshot capabilities
  • Retrieval tools: query contents, collections, feeds, conversations, and relevant sources
  • RAG workflows: prompt LLM conversation tooling for contextualized responses
  • Extraction tools: structured JSON extraction from unstructured text
  • Publishing: generate audio (ElevenLabs) and images (OpenAI)
  • Connectors for Slack, Google Drive, Gmail, Notion, GitHub, Jira, Linear, Dropbox, Box, OneDrive, SharePoint, and more

Installation / Configuration

Prerequisites:

  • Node.js 18+ recommended
  • A Graphlit account and API settings (Organization ID, Environment ID, JWT secret)

Install and run via npx (quick demo):

# one-time install & run (will prompt or read environment variables)
npx -y graphlit-mcp-server

Or install as a local dependency:

npm install @graphlit/graphlit-mcp-server
npx graphlit-mcp-server

Environment variables

VariablePurpose
GRAPHLIT_ORGANIZATION_IDYour Graphlit organization ID (from portal.graphlit.dev)
GRAPHLIT_ENVIRONMENT_IDGraphlit environment/project ID
GRAPHLIT_JWT_SECRETSecret used to sign JWTs for MCP client authentication

Example export (Linux / macOS):

export GRAPHLIT_ORGANIZATION_ID="org_abc123"
export GRAPHLIT_ENVIRONMENT_ID="env_abc123"
export GRAPHLIT_JWT_SECRET="replace_with_a_strong_secret"
npx graphlit-mcp-server

By default the server listens on localhost and exposes HTTP endpoints for MCP clients. Check the process output to confirm the listening port (commonly 3000).

Available Tools / Resources

The server exposes a comprehensive set of tools (grouped):

  • Retrieval: query contents, query collections, query feeds, retrieve similar images, visually describe image
  • RAG: prompt LLM conversation
  • Extraction: extract structured JSON from text
  • Ingestion: add files, web pages, messages, emails, issues, and memory
  • Publishing: publish audio (ElevenLabs), publish image (OpenAI)
  • Web: web crawl, web search (including podcast search), screenshot page
  • Operations: configure project, create/delete collections, add/remove content, delete feeds/conversations, check ingestion status
  • Connectors: Slack, Google Drive, Gmail/Outlook, Notion, Discord, Teams, GitHub, Jira, Linear, Dropbox, Box, OneDrive, SharePoint, RSS podcasts, Twitter/X

Use the server UI or the tools listing endpoint to see available tool names and their parameter shapes.

Client example (Node.js)

Below is a minimal client flow: sign a JWT using your GRAPHLIT_JWT_SECRET, request the server’s tools list, and invoke a retrieval tool. This uses node-fetch and jsonwebtoken.

Install dependencies:

npm install node-fetch jsonwebtoken

Client (example):

// client.js
import fetch from 'node-fetch';
import jwt from 'jsonwebtoken';

const SERVER = 'http://localhost:3000'; // adjust if different
const SECRET = process.env.GRAPHLIT_JWT_SECRET || 'replace_with_secret';

// create a short-lived JWT for the client
const token = jwt.sign(
  { sub: 'client-1', typ: 'mcp-client' }, // payload (customize as needed)
  SECRET,
  { algorithm: 'HS256', expiresIn: '10m' }
);

// list tools
const listTools = await fetch(`${SERVER}/tools`, {
  headers: { Authorization: `Bearer ${token}` }
});
console.log('tools:', await listTools.json());

// invoke a retrieval tool (example: query_contents)
const body = {
  tool: 'query_contents',
  params: { query: 'how to configure webhooks', limit: 5 }
};

const resp = await fetch(`${SERVER}/tools/query_contents/run`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${token}`,
    'Content-Type': '