How to Use MCP Servers with Claude Code to Read and Write Data in Your Apps
Model Context Protocol servers let Claude Code interact with Notion, Gmail, HubSpot, and more. Learn how to connect, configure, and use MCPs in real workflows.
What MCP Servers Actually Do in Claude Code
Claude Code is a capable coding agent on its own. But without connections to external tools, it’s working in isolation — reading and writing files on your local machine and that’s mostly it.
MCP servers change that. The Model Context Protocol is an open standard that lets Claude Code interact with external services: databases, SaaS tools, APIs, file systems, and more. Instead of writing custom integration code every time you want Claude to touch a new tool, you install an MCP server and Claude gains a structured set of capabilities it can call on demand.
If you’re new to the underlying standard, a deeper look at how MCP servers work covers the protocol mechanics well. This article focuses on the practical side: how to connect MCP servers to Claude Code and what you can actually do with them in real workflows.
The short version: with the right MCPs configured, Claude Code can read from your Notion workspace, query your HubSpot contacts, pull Gmail threads, update Airtable rows, and push changes back — all as part of an agentic task you’ve described. That’s a meaningful difference from a coding assistant that only knows what’s in your repo.
Setting Up MCP Servers in Claude Code
Claude Code supports MCP configuration at two scopes: project-level (shared with your team via the repo) and user-level (your own local config). You’ll use both depending on the use case.
Prerequisites
Before adding any MCP server, you need:
- Claude Code installed and authenticated with your Anthropic account
- The MCP server package or binary you want to use (most are Node.js packages available via npm, though some are Docker containers or standalone executables)
- Any credentials or API keys the MCP server requires (e.g., a Notion integration token, a HubSpot API key)
Adding an MCP Server via CLI
The fastest way to add an MCP server is through Claude Code’s built-in command:
claude mcp add <server-name> <command> [args...]
For example, to add the official Notion MCP server:
claude mcp add notion npx @notionhq/notion-mcp-server
Claude Code will register this server and make its tools available in your next session. You can pass environment variables for credentials using the -e flag:
claude mcp add notion npx @notionhq/notion-mcp-server -e NOTION_API_KEY=your_key_here
To list all configured servers:
claude mcp list
To remove one:
claude mcp remove notion
Adding an MCP Server via the Settings File
If you prefer editing config directly — or you want to commit MCP config to a shared project — Claude Code reads from .claude/settings.json in your project root (project-level) or from ~/.claude/settings.json (user-level).
The relevant section looks like this:
{
"mcpServers": {
"notion": {
"command": "npx",
"args": ["@notionhq/notion-mcp-server"],
"env": {
"NOTION_API_KEY": "your_key_here"
}
},
"hubspot": {
"command": "npx",
"args": ["@hubspot/mcp-server"],
"env": {
"HUBSPOT_ACCESS_TOKEN": "your_token_here"
}
}
}
}
Project-level config (.claude/settings.json) is useful when your whole team needs the same MCP servers. Commit this file but keep secrets out of it — use environment variables or .env files that aren’t tracked.
Scoping: Local vs. Project vs. User
Claude Code distinguishes between three scopes:
- Local — your machine only, not committed
- Project — committed to the repo, shared with anyone who clones it
- User — your global config across all projects
For MCP servers that connect to company-wide tools (like a shared HubSpot account), project scope usually makes sense. For personal tools (your own Gmail or personal Notion workspace), user scope keeps things tidy.
Which MCP Servers Are Worth Connecting First
There’s a growing ecosystem of MCP servers. These are the ones that deliver immediate, practical value in real business workflows.
Notion
The official @notionhq/notion-mcp-server gives Claude Code tools to search pages, retrieve database rows, create pages, and append blocks. If your team uses Notion for project tracking, meeting notes, or documentation, this is a high-value connection.
Practical use: Ask Claude to pull all open action items from a Notion database, summarize them by owner, and draft a status update.
Gmail and Google Workspace
Google Workspace integrations via MCP let Claude read email threads, create drafts, access Google Docs, and query Sheets. If you’re building workflows that touch your inbox or documents, this is foundational.
There’s a detailed walkthrough of building an AI executive assistant with Claude Code and Google Workspace that covers how to configure this and what it can do end to end.
HubSpot
The HubSpot MCP server exposes contacts, companies, deals, and notes as readable and writable objects. Claude can query your CRM, update deal stages, log notes after a meeting, and create new contacts — all from natural language instructions.
This pairs well with using HubSpot and AI agents to automate marketing funnels, especially when Claude Code is handling multi-step workflows rather than single queries.
Filesystem and GitHub
The @modelcontextprotocol/server-filesystem gives Claude controlled access to a directory on your machine — useful for reading and writing local files without going through standard code editing. The GitHub MCP server adds the ability to create issues, open PRs, read file contents from remote repos, and search code.
Airtable, Slack, and Others
Airtable MCP servers let Claude treat your bases as structured databases — querying records, updating fields, creating rows. For teams already using Airtable as a lightweight database, this is more useful than most people expect. If you’re connecting AI agents to structured data workflows, connecting AI agents to Airtable is worth reading alongside this guide.
Slack MCP integration is also gaining ground — particularly as Slack’s own agentic capabilities develop. Claude Code can post messages, read channels, and act on Slack data as part of a larger workflow.
Reading Data Through MCP: How Claude Code Queries Your Tools
Once an MCP server is running, Claude Code exposes its tools automatically in any session where that server is active. You don’t manually invoke tools — Claude decides when to call them based on your instructions.
Here’s what that looks like in practice.
How Claude Discovers What’s Available
When a session starts, Claude Code queries each configured MCP server for its tool list. Each tool has a name, a description, and a schema for its inputs and outputs. Claude reads these descriptions and uses them to decide which tool to call for a given task.
This is why tool descriptions in MCP servers matter so much. If the description is vague or incomplete, Claude may not use the tool correctly — or may not use it at all. The MCP server trap explains why a well-shaped API wrapper still fails if the tools aren’t described in terms an agent can act on.
A Simple Read Example
Say you have the Notion MCP server configured and you ask Claude:
“Look at the content roadmap database in Notion and tell me which articles are in ‘Draft’ status and haven’t been updated in the past two weeks.”
Claude will:
- Call the Notion MCP’s
query_databasetool with the appropriate filter parameters - Receive the matching records
- Parse the results and surface the relevant articles to you
You didn’t write any code. You didn’t touch the Notion API. Claude handled the query because it understood what you asked and had a tool that could do it.
Reading Across Multiple Sources
Claude Code can call tools from multiple MCP servers in the same session. A more complex read task might look like:
“Check Gmail for any emails from our top 10 HubSpot deals in the last 48 hours. Summarize what each email was about.”
Claude would:
- Query HubSpot for the top 10 deals by value
- Extract the associated contact email addresses
- Search Gmail for recent threads from those addresses
- Summarize each relevant thread
That’s cross-tool reasoning using structured data — something that wasn’t practical without the MCP layer connecting everything.
Writing Data Through MCP: Closing the Loop
Reading is useful. Writing is where the actual automation happens.
MCP tools aren’t just getters. Most well-built MCP servers include write operations: creating records, updating fields, sending messages, appending content. Claude Code can use all of these as part of a task.
A Write Example: Logging a Meeting to HubSpot
After a sales call, you might tell Claude:
“Create a note in HubSpot on the Acme Corp deal. The call was on April 14. We discussed Q3 expansion, pricing, and a potential POC. Next steps: send a proposal by April 21.”
Claude calls the HubSpot MCP’s create_note tool with the structured data, associated to the correct deal. The CRM is updated without you touching the UI.
Creating and Updating Notion Pages
The Notion MCP supports creating new pages and appending blocks to existing ones. That means Claude can:
- Generate a project brief and create it as a Notion page automatically
- Append a weekly summary to a running log page
- Update the status field on a database record after completing a task
Chaining Reads and Writes
The most powerful pattern is a loop: read data, process it, write the result back. For instance:
“Go through the ‘Unprocessed Leads’ view in our HubSpot CRM. For each lead without a follow-up task, create a task assigned to the correct rep based on territory.”
Claude reads, reasons about what’s missing, and writes new records — all in one pass. This is what agentic workflow patterns in Claude Code look like when MCP gives the agent real data to work with.
Handling Errors and Failures Gracefully
MCP tools can return errors — a record doesn’t exist, a permission is missing, a rate limit is hit. Claude Code generally handles these by reporting back what went wrong rather than silently failing. You can also prompt Claude to handle errors explicitly:
“If a HubSpot update fails, log the failure to a local CSV file for review.”
Claude will use the filesystem MCP (or write to a local file directly) to capture failures, giving you a recoverable error log.
Managing Token Overhead with Multiple MCP Servers
Here’s something most tutorials skip: every MCP server you connect adds tool descriptions to Claude’s context window. With one or two servers, this is negligible. With six or seven servers each exposing dozens of tools, it adds up fast.
Claude Code’s MCP token overhead is a real cost consideration, not just a performance one. More tokens in context means higher inference costs per request and potentially slower responses.
Practical ways to manage this:
- Only activate the servers you need. Don’t register ten MCP servers if you’re only using two for a given project. Use project-level vs. user-level scoping strategically.
- Prefer focused tools over broad ones. An MCP server with five well-defined tools is better than one with fifty vague ones — for both token efficiency and accuracy.
- Use task-scoped sessions. If a specific workflow only needs HubSpot and Gmail, run it in a session where only those servers are active.
- Consider the Conway Extension Format. Anthropic has been developing the Conway extension format as a way to make tool descriptions more efficient and agent-readable. Worth tracking as it matures.
For most workflows with two to four well-chosen MCP servers, token overhead won’t be a practical problem. It becomes an issue when people add servers speculatively rather than purposefully.
Real Workflow Examples You Can Build Today
These are concrete, end-to-end workflows that become possible once you’ve connected the right MCP servers to Claude Code.
Weekly CRM Hygiene
MCPs needed: HubSpot, Google Sheets (or Airtable)
Claude reviews all HubSpot deals updated in the past week, identifies any without a scheduled next step, and logs them in a Google Sheet for the sales team’s review. Runs on a schedule via a cron job that calls Claude Code in headless mode.
Email-to-CRM Pipeline
MCPs needed: Gmail, HubSpot
If you’re getting inbound leads by email, Claude can read the Gmail thread, extract key information (company name, contact, interest level, budget signals), and create or update the corresponding HubSpot contact and deal. This is a stripped-down version of what’s covered in more detail for AI email parsing and data entry automation.
Content Brief to Notion
MCPs needed: Notion, optionally GitHub or filesystem
A content team workflow: Claude Code takes a topic prompt, generates a structured content brief (target audience, angle, outline, SEO keywords), and creates it as a new Notion page in the editorial database. Writers open Notion and find the brief already structured and ready.
Research Report to ClickUp
MCPs needed: Filesystem or GitHub (for reading source data), ClickUp
Claude researches a topic (via web tools or local documents), writes a structured report, and creates a ClickUp task with the report attached as a comment. This kind of AI company research agent with Claude Code and ClickUp workflow is especially useful for sales and operations teams.
Social Post Scheduling
MCPs needed: Notion (for content calendar), Blotato or a social API
Claude reads approved content from a Notion database, adapts each piece to platform-specific formats, and schedules posts. There’s a solid breakdown of using Claude Code to automate social media posting that covers the scheduling layer in detail.
Where Remy Fits in MCP-Connected Development
MCP servers are great for connecting Claude Code to live data. But once you’re building applications that need to store, retrieve, and act on data persistently — that’s where Remy comes in.
Remy compiles annotated specs into full-stack apps: real backends, real SQL databases, real auth. If you’re using MCP connections in Claude Code to automate workflows, Remy is the right tool when you need those workflows to power an actual application rather than a one-off script.
Here’s the distinction: Claude Code with MCP servers is an agent working with your existing tools. Remy is how you build new tools from scratch — apps that can then become sources of data that future MCP connections can read from.
For example, you might use Claude Code with HubSpot and Gmail MCPs to run a lead enrichment workflow. But if you want a custom internal CRM with its own database, auth, and UI — that’s a Remy project. You write a spec describing what the app does, Remy compiles the full stack, and you deploy it in minutes.
If you’re already thinking about building an agentic business OS with Claude Code, Remy is a natural complement — it handles the infrastructure layer so the agent work stays focused on the logic.
You can try Remy at mindstudio.ai/remy.
Frequently Asked Questions
How do I know which MCP servers are available?
There’s no single authoritative registry yet, but the best places to look are:
- The MCP GitHub organization maintained by Anthropic, which includes official reference servers for common tools
- npm, where most community MCP servers are published as packages
- Smithery and Glama, which are emerging directories for MCP servers
For major SaaS platforms (HubSpot, Notion, Atlassian, GitHub), check the vendor’s own GitHub or developer documentation — several have published or are actively building official MCP servers.
Can Claude Code use MCP servers without me being present?
Yes. Claude Code supports a headless mode (--headless flag) that lets it run non-interactively, which is how you’d schedule automated workflows via cron or a CI system. In headless mode, MCP servers still initialize and function the same way. You’ll want to make sure any required credentials are available as environment variables in the execution environment.
What’s the difference between MCP servers and direct API calls in Claude Code?
You can have Claude Code write and execute code that calls APIs directly — that works too. The difference is that MCP servers give Claude a structured, declared interface it can reason about without writing new code each time. With a direct API call, Claude needs to know the API shape from its training data or from documentation you provide. With an MCP server, the tool schema is right there in the session context. MCP is more reliable and repeatable for established workflows.
Do MCP servers have access to my credentials?
MCP servers run as separate processes on your machine (or wherever you deploy them). They only have access to what you pass them — typically API keys or tokens via environment variables. They don’t automatically get access to your filesystem or other credentials. That said, you should treat MCP servers with the same scrutiny you’d give any dependency: review what they’re doing, use least-privilege credentials (read-only tokens where possible), and don’t install servers from untrusted sources.
How do I debug an MCP server that isn’t working?
Start with claude mcp list to confirm the server is registered. Then run Claude Code with --debug or check the logs (usually in ~/.claude/logs/). Common failures:
- The server command can’t be found (check that the npm package is installed globally or use
npx) - Credentials are missing or malformed (check your env variables)
- The server itself is erroring on startup (run the command directly in your terminal to see the raw output)
If Claude is connected to the server but not using its tools, the issue is usually that the tool descriptions don’t clearly signal when they should be used. You may need to prompt Claude more explicitly about which tool to reach for.
Can I build my own MCP server for a custom internal tool?
Yes, and it’s not complicated. The MCP SDK (available for TypeScript and Python) handles the protocol layer. You define your tools — each with a name, description, and input schema — and implement the handler logic. Build in an afternoon for a simple tool, a day or two for something more complex. This is worth doing if you have internal APIs or databases that no existing MCP server covers. Understanding the N×M integration problem helps explain why building one well-structured internal MCP server is often better than patching together multiple workarounds.
Key Takeaways
- MCP servers let Claude Code interact with real tools — reading from and writing to Notion, HubSpot, Gmail, Airtable, GitHub, and more.
- Configuration is straightforward — use
claude mcp addor edit.claude/settings.json. Project-level config is great for team-shared servers; user-level is for personal tools. - Reading and writing data both work — Claude can query records, summarize data, create new entries, update existing ones, and log errors, all from natural language instructions.
- Token overhead is real — only activate the MCP servers you need for a given workflow, and favor focused tool sets over bloated ones.
- The real power is chained workflows — reading from one source, reasoning, and writing to another is where MCP connections become genuinely useful for business automation.
- When you need a full application rather than an automated workflow, Remy is where to start — it compiles specs into full-stack apps with real backends and databases, no infrastructure wiring required.