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 27 days ago
Connect Latitude to Codex or Claude Code with MCP
Connect an AI assistant to Latitude so it can securely retrieve analytics, generate ideas, manage drafts, and schedule LinkedIn content.
Before you start
You need:
A Latitude account with MCP access enabled
At least one connected LinkedIn account
Codex CLI, Codex Desktop, or Claude Code
Access to a terminal
A Latitude MCP token
Latitude MCP is currently in private invite only access. We are providing it free of charge for AppSumo Tier 2 and 3 users. If you do not see Settings → Integrations → MCP tokens, contact Latitude Support to request access.
Keep your token private
Treat your MCP token like a password.
Never:
Paste it into an AI conversation
Commit it to a repository
Include it in a screenshot
Share it with another person
The token begins with lat_mcp_ and is displayed only once. Store it using your organization’s approved secrets method.
Step 1: Create a Latitude MCP token
Open Latitude Settings.
Select Integrations.
Find MCP tokens.
Enter a recognizable name, such as
Codex,Claude Code, or your own name.Select Create token.
Copy and securely store the token immediately.
Latitude shows each token’s status, expiration date, last-used time, and revocation controls.
If you lose a token, revoke it and create a new one.
Step 2: Make the token available to your client
The token must be available in the same environment that launches Codex or Claude Code.
macOS or Linux
Set the token without placing it directly in your shell command history:
read -s LATITUDE_MCP_TOKEN export LATITUDE_MCP_TOKENPaste the token when prompted and press Enter.
This applies only to the current terminal session. Launch Codex or Claude Code from that same terminal.
Windows PowerShell
Use a masked prompt:
$secure = Read-Host "Paste your Latitude MCP token" -AsSecureString $env:LATITUDE_MCP_TOKEN = [System.Net.NetworkCredential]::new("", $secure).PasswordLaunch Codex or Claude Code from that same PowerShell window.
Codex Desktop
Codex Desktop must receive the token when the application starts.
On Windows, after using the masked PowerShell prompt above, you can save it as a user environment variable:
[Environment]::SetEnvironmentVariable( "LATITUDE_MCP_TOKEN", $env:LATITUDE_MCP_TOKEN, "User" )Then fully quit Codex Desktop and reopen it.
If you use WSL, remember that Windows environment variables are not automatically available inside WSL. Set the variable in the environment where the client actually runs.
Use your organization’s approved secrets manager instead when required by policy.
Step 3: Connect your client
Choose the client you use.
Connect Codex
Run:
codex mcp add latitude \ --url https://api.get-latitude.com/mcp \ --bearer-token-env-var LATITUDE_MCP_TOKENConfirm the configuration:
codex mcp get latitude --json codex mcp listThen start a new Codex session:
codexInside Codex, run:
/mcpLatitude should appear as a connected MCP server with Latitude tools available.
Using Codex Desktop
Codex Desktop and Codex CLI use the same user-level Codex configuration.
After adding Latitude:
Fully quit Codex Desktop.
Confirm
LATITUDE_MCP_TOKENis available to the Desktop process.Reopen Codex Desktop.
Start a fresh task.
Allow up to 90 seconds for the first MCP connection.
Ask Codex to run the read-only test below.
An existing task may retain an older tool catalog even after the configuration changes. If Latitude is configured but its tools do not appear, fully restart Codex and open a fresh task.
Connect Claude Code
Add Latitude as a user-scoped HTTP server:
claude mcp add-json --scope user latitude \ '{"type":"http","url":"https://api.get-latitude.com/mcp","headers":{"Authorization":"Bearer ${LATITUDE_MCP_TOKEN}"}}'Confirm the configuration:
claude mcp get latitude claude mcp listThen start Claude Code:
claudeInside Claude Code, run:
/mcpLatitude should show as connected with its tools available.
No browser sign-in should be required. Latitude authenticates the connection using the MCP token supplied through the environment variable.
Step 4: Run a read-only test
Start with a request that cannot change anything:
List the LinkedIn accounts and Company Pages I can access in Latitude. Do not create or modify anything.
You are successfully connected when:
Latitude appears as connected in
/mcpLatitude tools are available
The request returns your accessible accounts or Company Pages
The token’s Last used time updates in Latitude Settings
If the server is listed but the read-only request fails, use the troubleshooting section below.
What Latitude MCP can do
Every tool is limited to the Latitude accounts, organizations, and posts your user can access.
Find accounts, posts, and analytics
latitude_list_linkedin_accounts— list accessible personal accounts and Company Pageslatitude_search_posts— search posts by account, organization, status, date, text, page, and sort orderlatitude_get_post— retrieve one post with its stored metadata and metricslatitude_get_analytics_summary— retrieve stored daily or monthly analyticslatitude_get_account_status— inspect connection and scheduling readiness
Generate and manage content
latitude_generate_content_ideas— generate up to ten content ideaslatitude_save_draft— create a text or image draftlatitude_update_draft— update an existing draft while retaining its medialatitude_delete_draft— delete a post while it is still a draft
Upload images
latitude_prepare_media_upload— prepare a JPEG, PNG, or GIF uploadlatitude_finalize_media_upload— verify the upload and make the asset available to a draft
A local image follows this workflow:
Prepare the upload.
Upload and finalize the image.
Save the draft using the finalized asset ID.
latitude_save_draft accepts finalized Latitude asset IDs or public HTTPS image URLs. It does not accept inline base64 image data.
Current limits include:
Up to nine images per draft
Up to 10 MiB per prepared image upload
Up to 3,000 post characters
Up to 4,086 alt-text characters per image
Plan and manage scheduling
latitude_preview_schedule— preview suggested scheduling slots without changing draftslatitude_schedule_draft— schedule a draft for a future timelatitude_unschedule_draft— return a scheduled post to draft status
Example requests
Read-only requests
Find my published posts from last month and summarize the strongest performers. Do not modify anything.
Show my daily LinkedIn analytics for the past 30 days.
Compare recent post performance by day of the week and time of day.
Draft requests
Save this copy as a draft for my Company Page. Do not schedule or publish it.
Create a Latitude draft using this image and add the following accessibility alt text. Do not schedule the post.
Scheduling requests
Preview a twice-weekly schedule for my unscheduled drafts in Eastern time. Do not schedule anything yet.
Schedule this exact draft for Thursday at noon Eastern time. Do not modify any other posts.
Move this scheduled post back to drafts. Do not delete it.
For actions that change content, identify the exact account or Company Page and clearly state whether the post should remain a draft, be scheduled, or be unscheduled.
Current limitations
Latitude MCP does not currently support:
Immediate publishing
Document or video uploads
Replacing images on an existing draft
Deleting scheduled, published, or failed posts through the draft-delete tool
Admin, billing, or raw database operations
Latitude currently authenticates its direct MCP endpoint with a bearer token. ChatGPT web and Claude.ai connector screens that require OAuth are not currently a self-service connection path.
Troubleshooting
MCP tokens is missing in Latitude
MCP has not been enabled for your account. Contact Latitude Support to request access.
LATITUDE_MCP_TOKEN is not set
The client cannot see the environment variable.
Confirm that:
The variable is set in the same terminal that launches the client
Codex Desktop was fully restarted after the variable was added
Windows and WSL are not being treated as the same environment
Do not paste the token into the AI conversation.
Unauthorized or 401 error
Check whether:
The token has expired
The token was revoked
The token contains leading or trailing whitespace
The client was restarted after the token changed
Avoid creating another token until you have checked the existing token’s status and Last used time.
Latitude is configured but its tools are missing
Fully quit and restart the client.
Open a fresh Codex task or Claude Code session.
Allow up to 90 seconds for the first connection.
Run
/mcpagain.
An existing task may retain the tool catalog it had when the task started.
The server is listed but does not work
A saved configuration does not always mean the server connected successfully.
Run:
codex mcp get latitude --jsonor:
claude mcp get latitudeThen check /mcp for the actual connection status and available tools.
A tool cannot find an account, Company Page, or post
MCP follows the same access rules as the Latitude application.
Confirm that:
Your user can access the account or Company Page in Latitude
The LinkedIn connection is active
The Company Page is available through the connected LinkedIn administrator
The post belongs to an account or organization you can access
The token’s Last used time is empty
The client has not authenticated successfully.
Recheck the environment variable, restart the client, and run the read-only connection test again.
You already configured Latitude
Inspect the existing configuration before adding another server or creating another token:
codex mcp get latitude --jsonor:
claude mcp get latitudeIf you contact Latitude Support, include:
Your operating system
Your client and version
The exact error message
Whether
/mcpshows LatitudeWhether the token’s Last used time changed
Never include the token itself or an unredacted screenshot containing it.