LinkAgent
This server lets you control a Chromium browser via CDP and extract structured data from LinkedIn or any website through browser automation.
Extract LinkedIn feed posts with authors, headlines, text, links, and engagement metrics.
Extract LinkedIn profiles, company pages, job listings/details, and search people or companies.
Navigate to any URL and take screenshots.
Execute arbitrary JavaScript in the current page.
List open browser tabs and scroll pages up or down.
Interact with pages: click elements, type text, send keyboard keys, get text/input values, and wait for elements by CSS selector.
Connects to a running Brave browser via Chrome DevTools Protocol to read the live DOM, navigate pages, manage tabs, interact with elements, and extract structured data.
Connects to a running Opera browser via Chrome DevTools Protocol to read the live DOM, navigate pages, manage tabs, interact with elements, and extract structured data.
Connects to a running Vivaldi browser via Chrome DevTools Protocol to read the live DOM, navigate pages, manage tabs, interact with elements, and extract structured data.
LinkAgent MCP
Universal browser extraction server using Chrome DevTools Protocol. Extract structured data from any website through an extensible plugin system.
How It Works
LinkAgent connects to a running Chromium browser via CDP (Chrome DevTools Protocol) — the same protocol Chrome DevTools uses internally. This means:
No browser automation — reads directly from the live DOM
Indistinguishable from normal browsing — no injected scripts, no headless flags
Works on any site — CDP sees exactly what you see
Cross-browser — Chrome, Edge, Opera, Brave, Vivaldi (anything Chromium-based)
Related MCP server: Ruishu MCP
Architecture
linkagent_mcp/
├── server.py # MCP protocol, tool routing
├── config.py # Environment-based configuration
├── logging.py # Structured logging setup
├── cdp/
│ ├── browser.py # Browser discovery (cross-platform)
│ └── client.py # WebSocket CDP commands
├── core/
│ ├── base.py # BaseExtractor ABC
│ ├── registry.py # Tool registry, dynamic dispatch
│ └── models.py # Data models
└── sites/ # Site plugins (auto-discovered, currently no default site)
└── (add your own site plugin here)See docs/architecture.md for detailed design.
Quick Start
1. Start the browser explicitly selected by the user
On Windows, the global launcher requires the browser name so LinkAgent never silently switches browsers:
& "$env:USERPROFILE\.opencode\tools\Start-LinkAgent.ps1" -Browser chrome
# or: -Browser edge | opera | brave | vivaldiThe selected browser starts on 127.0.0.1:9222. By default the launcher creates or reuses a local credential-preserving profile mirror under %USERPROFILE%\\.opencode\\profiles\\LinkAgent-<browser>, because current Chromium versions may reject remote debugging against the default profile. The mirror copies the selected browser's last-used profile locally; LinkAgent does not inspect or transmit cookies or credentials. Use -DirectProfile only for browsers/profiles that support direct CDP attachment. If the selected browser is already running without CDP, fully close it and rerun; LinkAgent will not terminate it automatically. create_hidden_tab creates background targets in the same regular session. Incognito is available only when the user explicitly requests it and the tool call includes explicit_user_request: true.
2. Install and run
cd linkagent_mcp
pip install -e .
python -m linkagent_mcp3. Use from any MCP client
The server exposes these tools:
Tool | Description |
| Navigate to any URL |
| Capture a page screenshot |
| Run arbitrary JavaScript |
| List open browser tabs |
| Scroll the current page |
| Page interaction |
| Tab management; hidden tabs reuse the existing regular session, incognito is opt-in |
| Initialize a concise evidence-first execution envelope for interactive or background work |
| Capture an immutable request, build a request-preserving plan |
| Store source excerpts, provenance, and evidence-bound claims |
| Record corrections and retire active hypotheses |
| Enforce coverage gates and compile supported claims only |
| Job and read-only browser health state |
(site plugins auto-discovered via | Extensible per-site extractors |
See docs/tasks.md for detailed tool documentation.
Docker
Run in a containerized Chromium — no local browser needed.
# Build and run
docker compose up -d
# Check logs
docker compose logs -f
# Stop
docker compose downThe container runs headless Chromium with CDP exposed on port 9222. Login sessions persist in a Docker volume (chrome-profile).
Docker + Claude Desktop:
{
"mcpServers": {
"linkagent": {
"command": "docker",
"args": ["compose", "run", "--rm", "linkagent"]
}
}
}Docker + external CDP access:
The CDP port is exposed on localhost:9222. Other tools can connect directly:
import websockets, json
async with websockets.connect("ws://localhost:9222") as ws:
await ws.send(json.dumps({"id": 1, "method": "Target.getTargets"}))
print(await ws.recv())See docs/docker.md for advanced Docker configuration.
Configuration
Set via environment variables or a .env file:
LINKAGENT_CDP_PORT=9222 # CDP debugging port
LINKAGENT_CDP_HOST=127.0.0.1 # CDP host
LINKAGENT_LOG_LEVEL=INFO # DEBUG, INFO, WARNING, ERROR
LINKAGENT_LOG_FILE=linkagent.log # Optional file logging
LINKAGENT_ALLOW_JS=0 # Arbitrary page JavaScript is disabled by default
LINKAGENT_ALLOW_INCOGNITO=0 # Use the existing regular profile by defaultEvidence-first execution
agent_init returns a compact execution contract with a configurable token budget. It is a deterministic checklist, not an exposure of private chain-of-thought. Background jobs are supported, but a query plan is never treated as evidence.
Use this order:
agent_init— chooseexecution_mode: "background", the selected browser, and the regular profile mode. Usebrowser_doctorfirst if the launcher did not report a ready CDP session.research_create— pass the exact request, explicit requirements, scope, and named primary sources.research_context/research_plan— inspect the immutable request and build a request-preserving plan.research_ingest— record each inspected URL, exact excerpt, locator, source type, and verification state.research_claim— bind material claims to evidence IDs.research_correct— record user corrections; active hypotheses are retired and the plan is rebuilt.research_auditwithfinal: true— do not synthesize as complete while coverage, freshness, contradiction, or request-integrity gates fail.research_synthesize— use supported claims only and expose unknowns.
The original request remains unchanged throughout the job. Memory is treated as an untrusted cache and cannot independently support a final claim.
See .env.example for all options.
Adding a New Site
See docs/adding-sites.md for a step-by-step guide.
sites/
└── twitter/
├── __init__.py # register(registry) function
└── extractors/
├── __init__.py
└── feed.py # Your extractor1. Create the extractor:
# sites/twitter/extractors/feed.py
from linkagent_mcp.core.base import BaseExtractor
class TwitterFeedExtractor(BaseExtractor):
"""Extract tweets from Twitter/X feed."""
async def extract(self, **kwargs) -> dict:
raw = await self._eval("""
(() => {
const tweets = [];
// ... your extraction logic ...
return JSON.stringify({ tweets });
})()
""")
return json.loads(raw)2. Register it:
# sites/twitter/__init__.py
from linkagent_mcp.core.registry import Registry
from .extractors.feed import TwitterFeedExtractor
def register(registry: Registry):
registry.register(
name="twitter_feed",
extractor_class=TwitterFeedExtractor,
domain="twitter.com",
description="Extract tweets from the feed",
input_schema={"type": "object", "properties": {}},
navigate_url="https://x.com/home",
url_patterns=["/home", "/search"],
)3. Restart the server — it's auto-discovered.
MCP Client Configuration
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"linkagent": {
"command": "python",
"args": ["-m", "linkagent_mcp"],
"cwd": "D:\\LinkAgent"
}
}
}Cursor / Windsurf
Add to your MCP settings:
{
"linkagent": {
"command": "python",
"args": ["-m", "linkagent_mcp"],
"cwd": "D:\\LinkAgent"
}
}Development
# Install dev dependencies
pip install -e .
# Run with debug logging
LINKAGENT_LOG_LEVEL=DEBUG python -m linkagent_mcp
# Run tests
python tests/test_live.pyRoadmap
See docs/roadmap.md for the full roadmap.
Current (v0.1.0)
Universal CDP-based extraction framework
Plugin system with auto-discovery (no bundled site lock-in)
Universal browser automation + evidence-first research controller
14 browser control tools + 28 total MCP tools
Concise execution initialization, background jobs, immutable request IR, evidence ledger, correction handling, and coverage gates
Cross-platform browser detection
Environment-based configuration
Structured logging
Next (v0.2.0)
Robustness — Auto-reconnection, health checks, error recovery
More data — Pagination, expanded sections, media extraction
More sites — Twitter/X, GitHub, Reddit, Instagram
Better output — Data storage, export formats, caching
Future Goals
Self-healing selectors — Automatically adapt to DOM changes
Write operations — Safe, controlled posting and messaging with human approval
Multi-browser — Multiple profiles, remote browsers, Docker support
Scheduling — Cron-like extraction, event-driven alerts
Analytics — Trend analysis, network analysis, competitive intelligence
Platform — Visual extractor builder, marketplace, cloud hosting
What We Want to Overcome
Problem | Current State | Goal |
Fragile selectors | Manual updates when LinkedIn changes | Self-healing, automatic adaptation |
Read-only | Cannot post, message, or interact | Controlled writes with approval |
Single browser | One profile, one session | Multiple browsers and profiles |
No scheduling | Manual extraction only | Cron jobs, event-driven alerts |
No storage | JSON output only | SQLite/PostgreSQL, CSV export |
No testing | Manual testing only | Snapshot tests, selector monitoring |
Deployment | Requires local browser | Docker, cloud, headless mode |
See docs/limitations.md for known issues.
Documentation
Architecture — System design and data flow
File Reference — What every file does
Tasks — Tool documentation and return values
Limitations — Known issues and constraints
Adding Sites — Step-by-step guide
Selector Strategy — How we pick stable DOM elements
Roadmap — Future plans and goals
License
MIT — see LICENSE.
Available Tools
16 toolsclickA
Click an element on the page by CSS selector. Triggers native mouse events (mousedown, mouseup, click).
Inputs: selector (required).
execute_jsB
Execute arbitrary JavaScript in the current page via CDP.
Inputs: script (required).
get_textB
Get the visible text content of an element by CSS selector.
Inputs: selector (required).
get_valueB
Get the current value of an input/textarea element.
Inputs: selector (required).
linkedin_companyB
Extract a LinkedIn company page. Provide company name or navigate first.
Inputs: company_name.
linkedin_feedB
Extract posts from the LinkedIn feed. Returns authors, headlines, post text, links, and engagement metrics.
Inputs: no named parameters.
linkedin_jobsB
Search jobs or extract job details. Provide keyword for search, or job_id for detail.
Inputs: job_id, keyword.
linkedin_profileB
Extract a LinkedIn person profile. Provide username or navigate to profile first.
Inputs: username.
linkedin_searchC
Search for people or companies on LinkedIn.
Inputs: keyword, search_type.
list_tabsA
List all open browser tabs.
Inputs: no named parameters.
scroll_pageB
Scroll the current page up or down.
Inputs: pixels, direction.
send_keysB
Send keyboard key presses (e.g. Enter, Tab, Escape). Useful for submitting forms, navigating, or closing modals.
Inputs: keys (required).
take_screenshotA
Take a screenshot of the current page.
Inputs: no named parameters.
type_textA
Type text into an input field or textarea by CSS selector. Focuses the element and types character by character.
Inputs: text (required), selector (required), clear, delay_ms.
wait_for_elementA
Wait until an element appears on the page (by CSS selector). Useful after navigation or clicking.
Inputs: selector (required), timeout_ms.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 16 tools
Each tool has a clear and distinct purpose: general browser automation tools (click, type, scroll, etc.) are separate from LinkedIn-specific tools (feed, profile, company, jobs, search). There is no ambiguity between get_text and get_value, or between type_text and send_keys.
Tools follow a predictable snake_case pattern, but general tools use verb_noun (e.g., send_keys, navigate) while LinkedIn tools use domain_noun (e.g., linkedin_feed, linkedin_search). This slight inconsistency within the set prevents a perfect score.
16 tools is well-scoped for a LinkedIn automation server. It provides a sufficient set of general browser interactions and dedicated LinkedIn scrapers without being excessive or sparse.
The tool set covers core LinkedIn data extraction (feed, profile, company, jobs, search) and essential browser actions. Minor gaps exist (e.g., no posting, messaging, or list connections), but these are likely out of scope for a scraping-focused server.
Maintenance
Related MCP Connectors
Managed LinkedIn MCP server for AI agents: search, connect, message and enrich on accounts you own.
The LinkedIn API for AI agents. Search, inbox, posts and outreach over MCP.
Live LinkedIn data for AI agents: profiles, companies, jobs, posts, email finding. No account risk.
LinkedIn jobs, companies and people for AI agents, plus messages and invites via your own account.
Related MCP Servers
- AlicenseAqualityDmaintenanceHigh-performance autonomous MCP server that turns LinkedIn into an API for AI workflows, enabling profile management, job search, content posting, and document generation.141MIT
- FlicenseAqualityAmaintenanceAn MCP server that bridges LLMs with dynamic real-world data by leveraging Chrome DevTools Protocol to intercept and reconstruct network traffic, enabling AI agents to extract high-quality structured data from complex web environments.389-
- FlicenseNot gradedqualityDmaintenanceMCP server for LinkedIn automation that enables AI agents to perform LinkedIn actions (search, inbox, feed, jobs, etc.) safely with human-like evasion and two-phase commit preview.3-
- FlicenseNot gradedqualityDmaintenanceMCP server for programmable LinkedIn automation via Playwright, offering 20 tools for profile management, messaging, feed interaction, and job searching through real browser automation.-