pinmeto-location-mcp
AGENTS.md15 starsChanged 4 months agoMITView on GitHub
This is an MCP (Model Context Protocol) server that provides AI agents like Claude with access to PinMeTo's location management platform. It exposes tools for fetching location data, insights from Google/Facebook/Apple, ratings, and keywords. The server requires these environment variables (loaded via --env-file=.env.local in npm scripts): - PINMETO_ACCOUNT_ID - PinMeTo account identifier - PINMETO_APP_ID - OAuth application ID - PINMETO_APP_SECRET - OAuth application secret - PINMETO_API_URL - (Optional, dev only) Override API base URL - PINMETO_LOCATION_API_URL - (Optional, dev only)…
- Reads credentials
- Commits and pushes
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 35,117 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.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
14 rules. About 0 are common, 9 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 18
⚠️ REQUIRED: Every PR must include a changeset.
- Distinctive: line 24
Before starting any feature, bug fix, or enhancement:
- Very specific: line 45
Add a changeset: npx changeset add (or --empty for non-release changes)
- Distinctive: line 67
NEVER commit directly to main without explicit user approval
- Distinctive: line 68
ALWAYS create a feature branch for any code changes
- Distinctive: line 69
ALWAYS create a PR for features and fixes
- Very specific: line 74
All tools follow the MCP best practice naming pattern: pinmeto_{action}_{network}_{resource}
- Very specific: line 89
Every tool in this server sets readOnlyHint: true and a human-readable title — the server only fetches data and never modifies state, and …
- Very specific: line 126
Use StdioServerTransport to simulate MCP protocol messages
- Distinctive: line 127
Test both success paths and error handling
- Distinctive: line 131
When ending a work session, work is NOT complete until git push succeeds.
- Distinctive: line 147
Verify: - All changes committed AND pushed
- Distinctive: line 151
NEVER push directly to main for code changes - use feature branches and PRs
- Distinctive: line 153
Always ask the user before any direct main branch operations
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 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
Agent Instructions
Project Overview
This is an MCP (Model Context Protocol) server that provides AI agents like Claude with access to PinMeTo's location management platform. It exposes tools for fetching location data, insights from Google/Facebook/Apple, ratings, and keywords.
Environment Configuration
The server requires these environment variables (loaded via --env-file=.env.local in npm scripts):
PINMETO_ACCOUNT_ID- PinMeTo account identifierPINMETO_APP_ID- OAuth application IDPINMETO_APP_SECRET- OAuth application secretPINMETO_API_URL- (Optional, dev only) Override API base URLPINMETO_LOCATION_API_URL- (Optional, dev only) Override locations API base URL
Releases and Changesets
⚠️ REQUIRED: Every PR must include a changeset. CI will reject PRs without one. For changes that don't affect the published package (docs, internal tooling), add an empty changeset with npx changeset add --empty.
For the full release workflow (version guidelines, release commands, maintainer flow), use the release skill.
Feature Development Workflow
Before starting any feature, bug fix, or enhancement:
Step 1: Create a Feature Branch
# NEVER work directly on main
git checkout main
git pull origin main
git checkout -b <branch-name> # e.g., feature/add-apple-ratings, fix/auth-timeoutBranch Naming Convention:
feature/<description>- New featuresfix/<description>- Bug fixesrefactor/<description>- Code refactoringdocs/<description>- Documentation onlychore/<description>- Tooling, dependencies, maintenance
Step 2: Do the Work
- Make commits to your feature branch
- Run tests:
npm test - Run build:
npm run build - Add a changeset:
npx changeset add(or--emptyfor non-release changes)
Step 3: Create a Pull Request
git push -u origin <branch-name>
gh pr create --title "feat: description" --body "..."Step 4: Get the PR Approved
- Request review
- Address feedback
- NEVER merge without approval
Step 5: Merge and Clean Up
# After PR approval and passing CI
gh pr merge --squash --delete-branch
git checkout main
git pull origin main⚠️ WORKFLOW CRITICAL RULES:
- NEVER commit directly to main without explicit user approval
- ALWAYS create a feature branch for any code changes
- ALWAYS create a PR for features and fixes
- Documentation-only changes MAY go to main with explicit user approval
Tool Naming Convention
All tools follow the MCP best practice naming pattern: pinmeto_{action}_{network}_{resource}
| Pattern | Example | Description |
pinmeto_get_{resource} | pinmeto_get_location | Single resource retrieval |
pinmeto_get_{resource}s | pinmeto_get_locations | Bulk resource retrieval (ALL) |
pinmeto_search_{resource}s | pinmeto_search_locations | Search/discovery tools |
pinmeto_get_{network}_{resource} | pinmeto_get_google_insights | Network-specific data (single or all) |
Unified Single/Bulk Pattern: Network tools accept an optional storeId parameter — without it they fetch all locations, with it a single location.
For the step-by-step process of adding a tool, use the add-tool skill.
Tool Annotations
Every tool in this server sets readOnlyHint: true and a human-readable title — the
server only fetches data and never modifies state, and directory submission requires a
title on every tool. All other annotations use SDK defaults. If a future tool writes, set
readOnlyHint: false and consider destructiveHint: true for deletes/overwrites and
idempotentHint: true where repeated calls have no additional effect.
Build Artifacts
src/generated/version.tsis a tracked, generated file — regenerated frompackage.jsonbyscripts/generate-version.mjson everyprebuild/pretest. Do not edit it, and do not add it to.gitignore; it is committed so barenpx tsc/npx vitestwork on a fresh checkout.- The
.mcpbis packed from the working directory, not from git..mcpbignoreis a deny-by-default allowlist (/*then!/build,!/node_modules, ...) with gitignore semantics: the packer uses theignorelibrary and does not read.gitignore, so a blocklist lets any untracked local directory into the bundle, and an unanchored rule likedistalso stripsnode_modules/*/dist.npm run verify:mcpb(run byrelease:draftandpack:test) unpacks the bundle, rejects unsafe paths and unexpected top-level entries, and starts the packed server. The first v4.1.0 asset shipped without this and failed to install. npm run bundleemitsdist/index.mjs, a self-contained single-file server bundle. It was vendored by thePinMeTo/claude-pluginsmarketplace repo; as of 2026-08-08 that marketplace is skill-only and no longer consumes it, so this artifact is currently unused pending a decision to retire it. It is still attached to GitHub releases byrelease:draftand excluded from the.mcpbvia.mcpbignore.
Failure Contracts
These are easy to get wrong from reading the call sites alone:
makePinMeToRequest()never throws and never returnsnull. It returns anApiResult<T>discriminated union (src/errors.ts):{ ok: true, data }or{ ok: false, error }. Narrow onokbefore touchingdata; failures are also logged to stderr.makePaginatedPinMeToRequest()returns a three-element tuple:[data[], areAllPagesFetched, lastError]. Destructuring only the first two silently drops the error.areAllPagesFetched: falsemeans pagination broke off partway, so partial data alongside a non-nulllastErroris the expected shape — not an empty dataset.- Insights tools default to
totalaggregation andnonecomparison. This is deliberate, for token efficiency — don't "helpfully" change the defaults to time series.
Protocol Notes
- Don't override the SDK's
initializeorserver/discoverhandlers. Capabilities are derived from whatcreateMcpServer()registers. A previous hand-written initialize override advertised aresourcescapability this server never implemented.serveStdio(() => createMcpServer())selects the protocol era and uses the SDK handlers for both openings. - Client identity is resolved per request in
PinMeToMcpServer._userAgent(context), never written toaxios.defaults. Modern requests readclientInfofromctx.mcpReq.envelope[CLIENT_INFO_META_KEY]; legacy requests fall back to the identity captured byinitialize. Every tool path that calls PinMeTo must pass its handler context through the request helpers. - Server identity is era-specific on the wire. Legacy clients receive
serverInfoin theinitializeresult. Modern clients receive it in_meta['io.modelcontextprotocol/serverInfo']on every response. The SDK stamps the sameImplementationobject in both cases, includingdescriptionandwebsiteUrl; do not add custom handshake handlers to move or gate those fields. - The MCP SDK is v2 (
@modelcontextprotocol/server) with Zod 4. Do not go back to@modelcontextprotocol/sdk1.x. The v1 line ended at 1.30.0 and emits JSON Schema draft-07 on every tool schema with no opt-out (typescript-sdk#2084); Claude Desktop rejects that dialect onoutputSchema, which broke every tool call for customers (PinMeTo/issues#6064). v2 emits 2020-12, andtests/mcp_server.test.tspins that dialect. Tool handler content blocks needtype: 'text' as const; v2's result types no longer accept a widened string. - MCP Sampling, Roots, and Logging are deprecated as of MCP
2026-07-28. Sampling support was removed in v4.0.0 — no client our customers use implemented it. Don't reintroduce them. Log to stderr (already the convention here); that is the recommended replacement for the Logging feature. - "Sampling" in this codebase now means review subsetting only (
applySamplingStrategy,samplingStrategy,samplingNote) — choosing which reviews to analyze. It has nothing to do with MCP Sampling. KeepsamplingNotefor messages about which reviews were analyzed (subset strategy, partial store failures); useanalysisNotefor messages about what analysis was performed. - Cached responses must carry the same
warningCodeas the fresh response they stand in for.InsightsCacheEntrystores it for exactly this reason — the insights cache key includesanalysisTypeandsamplingStrategy, so a dropped warning makes the second identical request look cleaner than the first. warningCodereports the single most actionable condition, not the most severe.LARGE_DATASET_WARNINGandINCOMPLETE_DATAoutrankUNDIFFERENTIATED_ANALYSIS_TYPEbecause callers key off the first two to decide whether to re-call. Secondary context belongs inanalysisNote(top level when the response has nometadata, e.g. the confirmation paths) rather than displacing the code.pinmeto_get_google_review_insightsonly differentiatessummaryandcomparison.performStatisticalAnalysis()populates onlysummary;performStatisticalLocationComparison()addslocationComparison. Nothing populatesthemes,issues, ortrends, and thethemesparameter is ignored. ThoseanalysisTypevalues are accepted and flagged withUNDIFFERENTIATED_ANALYSIS_TYPE. If you implement real extraction, remove the flag and the description caveat together.
Testing
Tests use Vitest with axios mocking. When writing tests:
- Mock axios for all API interactions
- Set required environment variables in
beforeAll - Use
StdioServerTransportto simulate MCP protocol messages - Test both success paths and error handling
Session Completion
When ending a work session, work is NOT complete until git push succeeds.
- Run quality gates (if code changed) - Tests, linters, build
- Add a changeset (if not already present) -
npx changeset addor--empty - Push and create PR:
# Feature branch (normal case): git push -u origin <branch-name> gh pr create --title "..." --body "..." # Main (only for documentation-only changes with user approval): git pull --rebase git push git status # MUST show "up to date with origin" - Clean up - Clear stashes, prune remote branches
- Verify - All changes committed AND pushed
Critical rules:
- Work is NOT complete until
git pushsucceeds - NEVER push directly to main for code changes - use feature branches and PRs
- Documentation-only changes MAY go to main with explicit user approval
- Always ask the user before any direct main branch operations
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.

