loading…
Search for a command to run...
loading…
Type-safe 3rd party integration SDK for the Integrate MCP server
Type-safe 3rd party integration SDK for the Integrate MCP server
A type-safe TypeScript SDK for connecting to the Integrate MCP (Model Context Protocol) server. Access GitHub, Gmail, Notion, and other integrations through a simple, integration-based API.
📚 Full Documentation | Server: https://mcp.integrate.dev/api/v1/mcp
client.github.createIssue())npm install integrate-sdk
# or
bun add integrate-sdk
⚠️ Important: Configure your OAuth apps with this redirect URI:
http://localhost:3000/api/integrate/oauth/callback
For production, use: https://yourdomain.com/api/integrate/oauth/callback
Define your OAuth providers once. Integrations automatically read credentials from environment variables:
// lib/integrate-server.ts (server-side only!)
import {
createMCPServer,
githubIntegration,
gmailIntegration,
} from "integrate-sdk/server";
// Integrations automatically use GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET,
// GMAIL_CLIENT_ID, GMAIL_CLIENT_SECRET from environment
export const { client: serverClient } = createMCPServer({
integrations: [
githubIntegration({
scopes: ["repo", "user"],
}),
gmailIntegration({
scopes: ["gmail.readonly"],
}),
],
});
That's it! Just import and export:
// app/api/integrate/[...all]/route.ts
import { serverClient } from "@/lib/integrate-server";
import { toNextJsHandler } from "integrate-sdk/server";
export const { POST, GET } = toNextJsHandler({
client: serverClient, // Pass the client
redirectUrl: "/dashboard",
});
This imports your config from step 1 and handles ALL OAuth operations (authorize, callback, status, disconnect) in one file!
Use the server client in API routes or server components:
// app/api/repos/route.ts
import { serverClient } from "@/lib/integrate-server";
export async function GET() {
// Automatically connects on first call - no manual setup needed!
const repos = await serverClient.github.listOwnRepos({ per_page: 10 });
return Response.json({ repos });
}
Use in your client components (no secrets needed):
"use client";
import { createMCPClient, githubIntegration } from "integrate-sdk";
const client = createMCPClient({
integrations: [
githubIntegration({
scopes: ["repo", "user"],
// No clientId or clientSecret needed!
}),
],
oauthFlow: { mode: "popup" },
});
// Authorize user (opens popup)
await client.authorize("github");
// Use the client - automatically connects!
const result = await client.github.createIssue({
owner: "owner",
repo: "repo",
title: "Bug report",
body: "Description of the bug",
});
console.log("Issue created:", result);
That's it! The SDK automatically:
connect() needed)disconnect() needed)The SDK automatically manages connections for you - no manual connect() or disconnect() calls needed!
Features:
// ✅ Default behavior - automatic connection
// Integrations automatically use GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET from environment
const client = createMCPClient({
integrations: [
githubIntegration({
scopes: ["repo", "user"],
}),
],
});
// Use immediately - no connect() needed!
await client.authorize("github");
await client.github.listRepos({ username: "octocat" });
// ✅ Want manual control? Use manual mode
const manualClient = createMCPClient({
integrations: [githubIntegration({ scopes: ["repo"] })],
connectionMode: "manual",
singleton: false,
});
await manualClient.connect();
await manualClient.authorize("github");
await manualClient.github.listRepos({ username: "octocat" });
await manualClient.disconnect();
Need help? Check out the complete documentation for detailed guides, examples, and API reference.
The SDK works in both environments:
createMCPClient() from 'integrate-sdk' - handles OAuth UI (popup/redirect)createMCPServer() from 'integrate-sdk/server' - includes OAuth secrets for API routesSee Quick Start above for complete examples.
Instead of generic tool calls, use typed methods with full autocomplete:
// ✅ New: Typed methods with autocomplete
await client.github.createIssue({
owner: "user",
repo: "project",
title: "Bug",
});
await client.gmail.sendEmail({ to: "[email protected]", subject: "Hello" });
// 1. Typed integration methods (recommended for built-in integrations like GitHub/Gmail)
await client.github.createIssue({
owner: "user",
repo: "project",
title: "Bug",
});
await client.gmail.sendEmail({ to: "[email protected]", subject: "Hello" });
// 2. Typed server methods (for server-level tools)
await client.server.listToolsByIntegration({ integration: "github" });
// 3. Direct tool calls (for other server-supported integrations)
await client._callToolByName("slack_send_message", {
channel: "#general",
text: "Hello",
});
The SDK implements OAuth 2.0 Authorization Code Flow with PKCE for secure authorization.
Key Features:
Basic Usage:
// Check authorization
if (!(await client.isAuthorized("github"))) {
await client.authorize("github"); // Opens popup or redirects
}
// Use authorized client
const repos = await client.github.listOwnRepos({});
For complete OAuth setup including:
See the /examples directory or OAuth documentation.
Schedule tool executions for specific times or recurring intervals. Perfect for sending scheduled emails, daily reports, automated reminders, and AI agents that need to schedule actions.
Key Features:
Quick Example:
// One-time trigger: Send email at specific time
const trigger = await client.trigger.create({
name: "Follow-up Email",
toolName: "gmail_send_email",
toolArguments: {
to: "[email protected]",
subject: "About the dog",
body: "Hey, just wanted to follow up...",
},
schedule: {
type: "once",
runAt: new Date("2024-12-13T22:00:00Z"),
},
});
// Recurring trigger: Daily standup reminder
await client.trigger.create({
name: "Daily Standup",
toolName: "slack_send_message",
toolArguments: {
channel: "#engineering",
text: "Time for standup! 🚀",
},
schedule: {
type: "cron",
expression: "0 9 * * 1-5", // 9 AM weekdays
},
});
// Manage triggers
const { triggers } = await client.trigger.list({ status: "active" });
await client.trigger.pause("trig_abc123");
await client.trigger.resume("trig_abc123");
await client.trigger.run("trig_abc123"); // Execute immediately
Setup Requirements:
createMCPServer() to store triggers→ Complete Triggers documentation
Access GitHub repositories, issues, pull requests, and more with type-safe methods.
// Available methods
await client.github.getRepo({ owner: "facebook", repo: "react" });
await client.github.createIssue({ owner: "user", repo: "repo", title: "Bug" });
await client.github.listPullRequests({
owner: "user",
repo: "repo",
state: "open",
});
await client.github.listOwnRepos({});
→ GitHub integration documentation
Send emails, manage labels, and search messages with type-safe methods.
// Available methods
await client.gmail.sendEmail({
to: "[email protected]",
subject: "Hello",
body: "Hi!",
});
await client.gmail.listEmails({ maxResults: 10, q: "is:unread" });
await client.gmail.searchEmails({ query: "from:[email protected]" });
→ Gmail integration documentation
Use genericOAuthIntegration to configure any server-supported integration:
import { genericOAuthIntegration } from "integrate-sdk/server";
// Automatically uses SLACK_CLIENT_ID and SLACK_CLIENT_SECRET from environment
const slackIntegration = genericOAuthIntegration({
id: "slack",
provider: "slack",
scopes: ["chat:write", "channels:read"],
tools: ["slack_send_message", "slack_list_channels"],
});
See /examples for complete setup patterns.
Give AI models access to all your integrations with built-in Vercel AI SDK support.
import { getVercelAITools } from "integrate-sdk";
import { generateText } from "ai";
import { openai } from "@ai-sdk/openai";
// Convert MCP tools to Vercel AI SDK format
const tools = getVercelAITools(mcpClient);
// Use with AI models
const result = await generateText({
model: openai("gpt-5"),
prompt: "Create a GitHub issue about the login bug",
tools,
maxToolRoundtrips: 5,
});
→ View Vercel AI SDK integration guide
For detailed guides, API reference, and examples, visit the complete documentation:
The SDK is built with TypeScript and provides full type safety with IntelliSense support out of the box.
Contributions are welcome! Please check the issues for ways to contribute.
# Run all tests
bun test
# Run with coverage
bun run test:coverage
See the tests/ directory for unit and integration test examples.
MIT © Revyo
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"integrate-sdk": {
"command": "npx",
"args": [
"-y",
"integrate-sdk"
]
}
}
}PRs, issues, code search, CI status
автор: GitHubDatabase, auth and storage
автор: SupabaseReference / test server with prompts, resources, and tools.
Secure file operations with configurable access controls.
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development