linkedin-mcp-server
AGENTS.md2 starsChanged 5 months agoApache-2.0View on GitHub
All scraping tools return: {url, sections: {name: raw_text}}. Optional additional keys: Always verify scraping bugs end-to-end against live LinkedIn, not just code analysis. Use uv run, not uvx, so the running process reflects your workspace. Use uvx only for packaged distribution verification. For live Docker investigations, refresh the source session first with uv run -m linkedin_mcp_server --login before testing each materially different approach. Assume a valid login profile already exists at ~/.linkedin-mcp/profile/.
- Sends data out
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 32,671 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository6 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- 1-triage-issuesSkill
- 2-repro-issueSkill
- 3-verify-pr-fixSkill
- btca-localSkill
- triage-reviewsSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
13 rules. About 0 are common, 4 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 7
Use uv for dependency management: uv sync (dev: uv sync --group dev)
- Very specific: line 13
Run server locally: uv run -m linkedin_mcp_server --no-headless
- Very specific: line 14
Run via uvx (PyPI/package verification only): uvx mcp-server-linkedin
- Very specific: line 21
Minimize DOM dependence: Prefer innerText and URL navigation over DOM selectors.
- Very specific: line 26
All scraping tools return: {url, sections: {name: raw_text}}.
- Distinctive: line 72
After the workflow completes, file a PR in the MCP registry to update the version.
- Very specific: line 76
Follow conventional commits: type(scope): subject
- Distinctive: line 78
Keep subject <50 chars, imperative mood
- Very specific: line 82
Always read CONTRIBUTING.md before filing an issue or working on this repository.
- Distinctive: line 92
When implementing a new feature/fix:
- Very specific: line 93
Check open issues. If no issue exists, create one following the templates in .github/ISSUE_TEMPLATE/.
- Very specific: line 96
Update README.md and docs/docker-hub.md if relevant
- Distinctive: line 97
Create a draft PR; only convert to regular PR when ready to merge
≈ “Common” is an estimate: at least 1 in 5 of the 41,581 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Development Commands
- Use
uvfor dependency management:uv sync(dev:uv sync --group dev) - Lint:
uv run ruff check .(auto-fix with--fix) - Format:
uv run ruff format . - Type check:
uv run ty check(using ty, not mypy) - Tests:
uv run pytest(with coverage:uv run pytest --cov) - Pre-commit:
uv run pre-commit installthenuv run pre-commit run --all-files - Run server locally:
uv run -m linkedin_mcp_server --no-headless - Run via uvx (PyPI/package verification only):
uvx mcp-server-linkedin - Docker build:
docker build -t linkedin-mcp-server . - Install browser:
uv run patchright install chromium
Scraping Rules
- One section = one navigation. Each entry in
PERSON_SECTIONS/COMPANY_SECTIONS(scraping/fields.py) maps to exactly one page navigation. Never combine multiple URLs behind a single section. - Minimize DOM dependence. Prefer innerText and URL navigation over DOM selectors. When DOM access is unavoidable, use minimal generic selectors (
a[href*="/jobs/view/"]) — never class names tied to LinkedIn's layout. - Detection must be locale-independent. Classification logic — connection state, action availability, button identity — must rely on URL patterns (
/preload/custom-invite/?vanityName=USER,/in/USER/edit/intro/,/messaging/compose/), attribute presence (aria-labelexists,aria-expandedexists,aria-disabledexists), or structural counts — never on text values like "Connect", "Follow", "Message", "1st", "Pending". The verb in anaria-labelis locale-dependent; whether the attribute exists is not. Where text is genuinely the only signal, guard it behind an explicit per-locale table and document the limitation in code.
Tool Return Format
All scraping tools return: {url, sections: {name: raw_text}}.
Optional additional keys:
references: {section_name: [{kind, url, text?, context?, value?}]}— LinkedIn URLs are relative paths;valuecarries non-URL identifiers (e.g. company URN id forkind: "company_urn")section_errors: {section_name: {error_type, error_message, issue_template_path, runtime, ...}}unknown_sections: [name, ...]job_ids: [id, ...](search_jobs only)references["feed"](get_feed only) — every entry iskind: "feed_post"; non-post anchors (sidebar profiles, employer logos) are filtered. URLs may carry either/feed/update/<urn>/(DOM-anchor-derived) or/posts/<slug>(SDUI-derived) form; both are valid LinkedIn permalinks. Cap is 50 entries, matchingget_feed'snum_postsceiling.
Verifying Bug Reports
Always verify scraping bugs end-to-end against live LinkedIn, not just code analysis. Use uv run, not uvx, so the running process reflects your workspace. Use uvx only for packaged distribution verification. For live Docker investigations, refresh the source session first with uv run -m linkedin_mcp_server --login before testing each materially different approach. Assume a valid login profile already exists at ~/.linkedin-mcp/profile/.
# Start server
uv run -m linkedin_mcp_server --transport streamable-http --log-level DEBUG
# Initialize MCP session (grab Mcp-Session-Id from response headers)
curl -s -D /tmp/mcp-headers -X POST http://127.0.0.1:8000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'
# Extract the session ID from saved headers
SESSION_ID=$(grep -i 'Mcp-Session-Id' /tmp/mcp-headers | awk '{print $2}' | tr -d '\r')
# Call a tool
curl -s -X POST http://127.0.0.1:8000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Mcp-Session-Id: $SESSION_ID" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"get_person_profile","arguments":{"linkedin_username":"williamhgates","sections":"posts"}}}'Release Process
git checkout main && git pull
uv version --bump minor # or: major, patch — updates pyproject.toml AND uv.lock
gt create -m "chore: Bump version to X.Y.Z"
gt submit # merge PR to trigger release workflowThe CI release workflow automatically updates manifest.json and docker-compose.yml with the new version — do not update them manually.
After the workflow completes, file a PR in the MCP registry to update the version.
Commit Messages
- Follow conventional commits:
type(scope): subject - Types: feat, fix, docs, style, refactor, test, chore, perf, ci
- Keep subject <50 chars, imperative mood
Development Workflow
Always read CONTRIBUTING.md before filing an issue or working on this repository.
- Write a short synthetic prompt that would reproduce the PR diff if given to a fresh Claude Code session. Don't copy the user's first message — distill the conversation into a single instruction that captures the full scope of changes. This tells the maintainer what was intended, which is often more useful than reviewing the full diff. Use a Markdown blockquote under a
## Synthetic promptheading, followed by the model attribution:## Synthetic prompt > Add `skills` and `projects` sections to `get_person_profile`, following the certifications PR pattern. Update fields, tests, docs, and manifest. Generated with <model name and version> - When implementing a new feature/fix:
- Check open issues. If no issue exists, create one following the templates in
.github/ISSUE_TEMPLATE/. Fill in every section; delete optional sections if not applicable. - Branch from
main:feature/issue-number-short-description - Implement and test
- Update README.md and docs/docker-hub.md if relevant
- Create a draft PR; only convert to regular PR when ready to merge
- Review with AI agents first, then manual review. PRs are squash-merged into
main(one commit per PR), so keep the PR title as the conventional-commit subject; commits within a PR are for review only.
- Check open issues. If no issue exists, create one following the templates in
PR Reviews
Greptile posts initial reviews as PR review comments, but follow-ups as issue comments. Always check both.
gh api repos/{owner}/{repo}/pulls/{pr}/reviews # initial reviews
gh api repos/{owner}/{repo}/pulls/{pr}/comments # inline comments
gh api repos/{owner}/{repo}/issues/{pr}/comments # follow-up reviewsbtca
When you need up-to-date information about technologies used in this project, use the btca-local skill to search the actual source repos. btca.config.jsonc is the resource registry; every resource is pre-cloned at ~/.btca/agent/sandbox/<resourceName> (e.g. fastmcp, playwrightPython). "Use btca with <resource> resource" means: search that clone. If a resource is missing from the sandbox, clone it with the url and branch from the manifest (the skill's "clone main by default" does not apply to registered resources).
New dependencies: When adding a new dependency, always add its repo to btca.config.jsonc (verify the default branch first: gh api repos/OWNER/REPO --jq '.default_branch') and clone it into the sandbox. Resource names are shared across projects in the sandbox, so pick a name that identifies the repo unambiguously (playwrightPython, not playwright).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

