Setting Up MCPs via the CLI
You don’t need to edit JSON configuration files to set up MCPs. You can ask the Cosine CLI to do it for you.
The Fast Way: Ask the Agent
Section titled “The Fast Way: Ask the Agent”The simplest approach is to just tell your agent what MCP you want:
“Please configure the Notion MCP for me.”
“Set up the PostHog MCP.”
“Add the Attio MCP and configure it.”
The agent will look up the correct configuration, update ~/.cosine/mcp.json, and let you know when it’s done. For MCPs that require authentication, it will tell you to click on the MCP in the panel to complete the OAuth flow.
Where MCP Config is Stored
Section titled “Where MCP Config is Stored”All MCP configurations live in a global file:
~/.cosine/mcp.jsonYou can also edit this file directly if you prefer, but using the CLI agent is usually faster and less error-prone. The MCP Configuration reference documents the full JSON format, and MCP Examples has ready-to-use configs for popular services.
Authenticating an MCP
Section titled “Authenticating an MCP”For MCPs that require login (most third-party services):
- After the agent configures the MCP, open the MCP panel in the CLI.
- Find the newly added MCP in the list.
- Press
Enteron it — this triggers the OAuth flow. - A browser window opens. Log in and approve access.
- The CLI stores the credentials automatically.
You only need to do this once per service. If you ever see authentication errors, you may need to re-authenticate (this can happen if credentials expire or are revoked).
Re-authenticating
Section titled “Re-authenticating”If an MCP stops working and shows an authentication error:
- Open the MCP panel.
- Select the affected MCP.
- Press
Enterto trigger the login flow again.
Checking What MCPs You Have
Section titled “Checking What MCPs You Have”To see all currently configured MCPs, open the MCP panel inside any CLI session. You’ll see a list of configured servers and their status (connected, disconnected, or requiring auth).
Alternatively, ask the agent:
“List my currently configured MCPs.”
Practical Examples
Section titled “Practical Examples”Once an MCP is configured and authenticated, you can use it naturally in any prompt:
Notion:
“Go to our GTM Notion page and absorb all the content. Save a summary to this folder.”
PostHog:
“Pull the last 7 days of feature flag events from PostHog and summarise the adoption trends.”
Attio (CRM):
“Find our 150 highest-ARR customers added in the last 30 days and draft outreach emails for each.”
The agent will discover the available data from the MCP automatically — you don’t need to specify endpoints or field names.
Key Takeaways
Section titled “Key Takeaways”- You can set up MCPs by asking the agent — no manual JSON editing required.
- MCP config is stored globally in
~/.cosine/mcp.json— see the MCP Configuration reference for full details. - Most MCPs require a one-time OAuth login via the MCP panel.
- Re-authenticate by pressing Enter on the MCP in the panel if it stops working.
- Browse ready-made configs in MCP Examples and manage running servers via MCP Server Management.