How Open-SEO Integrates with External Tools: A Complete Guide to GSC, GA4, and DataForSEO Connections
Open-SEO integrates with Google Search Console, Google Analytics 4, and DataForSEO through a modular MCP (Machine-Client-Protocol) layer that wraps each service in dedicated tool modules with unified authentication, response normalization, and credit-aware billing.
Every external tool connection in the every-app/open-seo repository follows the same architectural pattern: encapsulate provider complexity, expose a clean JSON-RPC interface, and centralize cost management. Whether you're self-hosting or using the hosted version, these integrations give you programmatic access to SEO data without vendor lock-in.
MCP Architecture: The Integration Backbone
Open-SEO's modular tool-centric architecture relies on its MCP layer to decouple external APIs from your application code. Each integration is a self-contained module in src/server/mcp/tools/ that handles four responsibilities:
- Authentication management — OAuth flows for Google services, API keys for DataForSEO
- Schema normalization — Zod-validated transformations into internal types
- Credit accounting — Usage tracking for paid APIs, free access for GSC reads
- RPC exposure — Plain JSON interfaces callable by AI agents, UI components, or third-party services
The request flow is consistent across all providers:
Client → MCP endpoint → Server-side tool → Provider SDK/HTTP → Provider API → Normalized response → Client
Google Search Console Integration (Free)
The Google Search Console (GSC) integration uses a free OAuth client with zero credit consumption. Located in src/server/lib/gscClient.ts, this client powers both hosted and self-hosted deployments without API charges.
The tool registration happens in src/server/mcp/server.ts at line 53, where GSC tools are imported and exposed:
// Get Google Search Console performance data (free, no credits)
import { getSearchConsolePerformanceTool } from '@/server/mcp/tools/search-console-tools';
const perf = await getSearchConsolePerformanceTool({
projectId: 'proj_123',
startDate: '2024-01-01',
endDate: '2024-01-31',
});
// → { clicks: 1240, impressions: 45000, avgPosition: 12.3, … }
Key implementation details:
- OAuth client handles token refresh automatically
- Rate limits are managed per-project
- Tests in
src/server/mcp/tools/search-console-tools.test.tsdemonstrate expected behavior
Google Analytics 4 Integration
The GA4 service in src/server/features/ga4/services/SearchOpportunityService.ts reuses the same OAuth infrastructure for hosted instances. For self-hosted deployments, it connects directly to GA4 Admin and Data APIs (lines 249-256).
// GA4 integration uses shared OAuth or direct API access
const ga4Service = new SearchOpportunityService({
projectId: 'proj_123',
propertyId: 'properties/123456789',
});
This integration enables search opportunity analysis by correlating organic traffic patterns with conversion data — a workflow that would otherwise require manual CSV exports.
DataForSEO Integration (Credit-Based)
All paid SEO data — keyword volumes, SERP results, backlinks, and AI-search insights — routes through the DataForSEO client. Unlike GSC, these calls deduct credits from your account.
The client spans multiple files:
src/shared/keyword-locations.ts— Location code validation (lines 5-8)src/shared/billing.ts— Credit accounting and error normalization (lines 11-32)
// DataForSEO keyword research (credits deducted)
import { keywordResearchTool } from '@/server/mcp/tools/dataforseo-research-tools';
const keywords = await keywordResearchTool({
projectId: 'proj_123',
seedKeyword: 'cloud-hosting',
locationCode: 2840, // United States
languageCode: 1000, // English
});
// → [{ keyword: 'cloud hosting pricing', volume: 5400, cpc: 2.3, … }]
Location codes follow DataForSEO Labs conventions. The create-project.ts tool (lines 28-44) accepts these market codes during project initialization.
Combining Tools in Workflows
Higher-level workflows compose multiple integrations. The rank-check workflow in src/server/workflows/RankCheckWorkflow.ts (line 353) intelligently chooses between live DataForSEO requests and queue-based tasks based on cost and urgency.
// Combine GSC data with live SERP inspection
import { inspectUrlsTool } from '@/server/mcp/tools/search-console-tools';
import { serpInspectTool } from '@/server/mcp/tools/dataforseo-research-tools';
const gscUrls = await inspectUrlsTool({
projectId: 'proj_123',
url: 'https://example.com'
});
const serp = await serpInspectTool({
keyword: gscUrls.topQuery,
locationCode: 2840,
languageCode: 1000,
});
// → Live SERP snapshot for your top-performing query
This pattern — free GSC data guiding paid DataForSEO calls — minimizes credit burn while maximizing insight depth.
Tool Registration and MCP Server
All integrations register through the central MCP server. The server imports tool modules and exposes them as RPC endpoints:
| Integration | Registration File | Key Lines |
|---|---|---|
| Google Search Console | src/server/mcp/server.ts |
Line 53 |
| DataForSEO research | src/server/mcp/tools/dataforseo-research-tools.ts |
Full module |
| Project creation | src/server/mcp/tools/create-project.ts |
Lines 28-44 |
Each tool module exports functions matching the MCP protocol, enabling any compatible client to invoke them without knowing the underlying provider details.
Authentication Patterns
| Service | Auth Method | Credit Cost |
|---|---|---|
| Google Search Console | OAuth 2.0 (per-user) | Free |
| Google Analytics 4 | OAuth 2.0 (per-user) | Free |
| DataForSEO | API key (account-based) | Per-request |
Self-hosted deployments can substitute their own OAuth credentials; the gscClient.ts and SearchOpportunityService.ts both detect environment configuration to switch modes.
Summary
- GSC integration (
src/server/lib/gscClient.ts) provides free, unlimited access to performance and indexing data via OAuth - GA4 integration (
src/server/features/ga4/services/SearchOpportunityService.ts) correlates traffic with conversions using shared auth - DataForSEO integration (
src/shared/billing.ts,src/shared/keyword-locations.ts) handles paid SEO data with automatic credit tracking - MCP layer (
src/server/mcp/server.ts) unifies all tools behind a consistent JSON-RPC interface - Workflow orchestration (
src/server/workflows/RankCheckWorkflow.ts) optimizes cost by selecting live vs. queued DataForSEO calls
Frequently Asked Questions
Does Open-SEO charge for Google Search Console API calls?
No. According to the every-app/open-seo source code, GSC integration uses a free OAuth client with zero credit deduction. The implementation in src/server/lib/gscClient.ts explicitly avoids billing for these operations, making it viable for both hosted and self-hosted deployments without usage limits.
What authentication methods does Open-SEO support for external tools?
Open-SEO uses OAuth 2.0 for Google services (Search Console and Analytics) and API keys for DataForSEO. The OAuth implementation handles token refresh automatically, while DataForSEO keys are validated against the credit balance in src/shared/billing.ts before each request.
How does Open-SEO prevent unexpected DataForSEO charges?
Every DataForSEO call passes through the credit accounting system in src/shared/billing.ts (lines 11-32). Credits are deducted only after successful response normalization, and the RankCheckWorkflow.ts can route expensive requests to a queue for batched processing. Projects must have sufficient credits before paid tools execute.
Can I use Open-SEO's tool integrations without the full platform?
Yes. The MCP architecture exposes plain JSON-RPC endpoints that any compatible client can invoke. The tools in src/server/mcp/tools/ are designed for AI agents, custom UIs, or third-party services — no platform lock-in required.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →