How to Connect Latitude to Codex CLI or Claude Code with MCP
Connect an AI coding assistant to Latitude, create a secure MCP token, and use the tools available in the current private beta.
Written By Brian Martynowicz
Last updated 11 days ago
Latitude’s Model Context Protocol (MCP) integration lets supported AI coding assistants securely work with the Latitude accounts and organizations you can access. After connecting, you can ask your assistant in plain language to find posts, review stored performance data, generate ideas, create or update drafts, and plan or schedule content.
Availability: Latitude MCP is currently a private beta for Codex CLI and Claude Code. If you do not see Settings → Integrations → MCP tokens, MCP has not been enabled for your account yet.
Keep your MCP token private. Treat it like a password. Never paste it into an AI conversation, commit it to a repository, include it in a screenshot, or share it with another person. Configure it outside the chat in your terminal or approved secrets manager.
What you can do with Latitude MCP
The current private beta exposes the following tools. Every tool is limited to the Latitude accounts, organizations, and posts your user can access.
Find accounts, posts, and performance data
latitude_list_linkedin_accounts— list your owned and shared LinkedIn accounts and active organizations.latitude_search_posts— search accessible posts by account, organization, status, date range, text, page, and sort order.latitude_get_post— retrieve one accessible post with safe metadata and its latest stored metrics.latitude_get_analytics_summary— retrieve stored daily or monthly analytics for an accessible personal account or organization.latitude_get_account_status— inspect the connection and scheduling status of an accessible LinkedIn account.
Plan and create content
latitude_generate_content_ideas— generate up to 10 AI-assisted LinkedIn content ideas for an accessible account or organization, with an optional custom prompt.latitude_save_draft— create a text draft with optional JPEG, PNG, or GIF images and accessibility alt text. A draft can include up to 9 images and 10 MB of decoded image data in total.latitude_update_draft— update draft text and optional organization mention metadata while keeping existing media.latitude_delete_draft— delete an accessible post only while it is still a draft.
Plan and manage scheduling
latitude_preview_schedule— preview bulk scheduling slots without changing any drafts.latitude_schedule_draft— schedule an accessible draft for a future time, including Latitude auto-scheduling when a timezone is supplied.latitude_unschedule_draft— move a scheduled draft back to draft status and remove its scheduled publish job.
Create a Latitude MCP token
Open Latitude Settings.
Choose Integrations, then find MCP tokens.
Enter a recognizable token name, such as
Codex,Claude Code, or your own name.Select Create token.
Copy the token immediately and store it securely. It begins with
lat_mcp_and is shown only once.
Latitude shows each token’s status, expiration date, and last-used time. You can revoke an active token at any time. If you lose a token, revoke it and create a new one.
Connect with Codex CLI
These instructions are for Codex CLI in Terminal, not the Codex chat app.
First, set the token as an environment variable in the same terminal window:
export LATITUDE_MCP_TOKEN="lat_mcp_..."Replace lat_mcp_... with the token you copied from Latitude. Then add the remote MCP server:
codex mcp add latitude --url https://api.get-latitude.com/mcp --bearer-token-env-var LATITUDE_MCP_TOKENVerify the connection and start Codex:
codex mcp listcodexInside Codex, run /mcp to inspect connected MCP servers.
The export command applies only to the current terminal window. For future sessions, store the token using your organization’s approved secrets method or shell configuration. If your shell history is shared or audited, use a secure secret prompt or manager instead of typing the raw token into a command.
Connect with Claude Code
Set the token in the same terminal window:
export LATITUDE_MCP_TOKEN="lat_mcp_..."Add Latitude as a user-scoped HTTP server. This configuration keeps the raw token out of the Claude configuration and expands the environment variable when Claude Code starts:
claude mcp add-json --scope user latitude '{"type":"http","url":"https://api.get-latitude.com/mcp","headers":{"Authorization":"Bearer ${LATITUDE_MCP_TOKEN}"}}'Verify the connection and start Claude Code:
claude mcp listclaudeInside Claude Code, run /mcp to view the configured server and its tools. No browser sign-in should be required because the bearer token is supplied through the environment variable.
The command examples above use macOS/Linux shell syntax. On Windows, set LATITUDE_MCP_TOKEN in PowerShell or use your approved secrets manager before starting the client.
Example requests
Once connected, ask your coding assistant naturally. For example:
“List the LinkedIn accounts and Company Pages I can access in Latitude.”
“Generate five post ideas for my personal account about leading a remote team.”
“Find my published posts from last month and summarize the strongest performers.”
“Show my daily LinkedIn analytics from Latitude for the past 30 days.”
“Save this copy as a Latitude draft and attach the image with alt text.”
“Preview a twice-weekly schedule for my unscheduled drafts in Eastern time.”
“Schedule my latest draft for Thursday at noon Eastern time.”
“Move that scheduled post back to drafts.”
Current limitations
Latitude MCP does not currently support:
immediate publishing
document or video upload
replacing images on an existing draft
deleting scheduled, published, or failed posts through the draft-delete tool
admin, billing, or raw database operations
This guide covers Codex CLI and Claude Code. Latitude currently authenticates its direct MCP endpoint with a static bearer token, so native ChatGPT or Claude.ai connector screens that require OAuth are not a self-serve connection path yet.
Troubleshooting
Integrations or MCP tokens is missing: the private beta is not enabled for your Latitude account.
The client reports an unauthorized connection: confirm
LATITUDE_MCP_TOKENis set in the same terminal, then check whether the token is expired or revoked in Latitude.You lost the token: Latitude cannot display it again. Revoke the old token and create a new one.
A tool cannot find an account or post: MCP follows the same Latitude access rules as the app. Confirm that your user can access that account, organization, or post in Latitude.