MCP server: A step-by-step guide to building from scratch

MCP server: A step-by-step guide to building from scratch

Jul 3, 2025

Jul 3, 2025

As AI continues to revolutionise software development, integrating it within workflow using IDEs like Cursor and Windsurf is becoming normal for developers. However, there is still a pain point: integrating tools, external services like APIs, and local data with IDEs/AI.

Although methods like Function Calling, Tool Calling, and RAG exist, they are often painful, time-consuming, and require domain knowledge. What if this process could be simplified?

A game changer, right?

The Model Context Protocol (MCP) does just that without breaking a sweat💧. So, what is it, how to use it, how to integrate MCP in an IDE, and what are some advanced use cases of MCP?

Let’s find out!

What is MCP

Think of MCP as a USB-C port on a laptop. With it, you can charge your computer, transfer data, connect to other displays, and charge other Type-C supported devices.

Similarly, the Model Context Protocol provides a standard, secure, real-time, two-way communication interface for AI systems to connect with external tools, API Services, and data sources.

This means that, unlike traditional API integration, which requires separate code, documentation, and maintenance, MCP can provide a single, standardised way for AI models to interact with external systems. You write code once, and all AI systems can use it.

The key differences between MCP and traditional APIs include:

Feature

Model Context Protocol (MCP)

Traditional API (REST / GraphQL / gRPC)

Primary purpose

Give LLM-based agents a single way to fetch context and invoke side-effecting tools.

General machine-to-machine data exchange & business logic.

Integration effort

Once an agent speaks MCP, it can talk to any compliant server; only one SDK/wire-spec to learn.

Each API exposes its own spec/SDK; you integrate them one by one.

Interaction model

Stateful sessions + bidirectional messaging; supports long-running tasks and mid-job progress callbacks.

Stateless request/response; usually unidirectional.

Streaming support

Standardised via “Streamable HTTP” (SSE/WebSocket).

Not part of the REST spec; developers bolt on WebSockets/SSE ad hoc.

Extensibility (adding new capabilities)

The server can add new tools/resources without breaking clients; the agent discovers them at runtime.

Breaking changes need versioning, or clients must update to use new endpoints/types.

Standardisation/wire format

One JSON-Schema-driven spec for inputs & outputs, plus defined transports.

Multiple styles (REST, GraphQL, gRPC) with differing auth headers, error shapes, and media types.

Maturity & tooling

Rapidly growing, but still early; dozens of open-source servers and early commercial support.

Decades of best-practice guides, gateways, SDKs, APM, and monitoring.

Performance path length

Extra hop (agent → MCP → underlying API) adds a bit of latency; streaming mitigates waiting for large payloads.

Direct call; generally lower overhead for high-QPS, deterministic workloads.

Typical sweet-spot use-cases

Autonomous agents chaining multiple tools, dynamic workflows, and user-in-the-loop

CRUD data services, stable integrations, high-throughput micro-services.

MCP enables two-way communication, allowing AI models to retrieve information and dynamically trigger actions. This makes it perfect for creating more intelligent and context-aware applications. Check out this blog on Model Context Protocol for a full breakdown.

So, how does this all work?

MCP Components

The MCP architecture consists of several key components that work together to enable seamless integration:

  1. MCP Hosts: These are applications (like Claude Desktop or AI-driven IDEs) that need access to external data or tools

  2. MCP Clients: They maintain dedicated, one-to-one connections with MCP servers.

  3. MCP Servers: Lightweight servers that expose specific functionalities via MCP, connecting to local or remote data sources.

  4. Local Data Sources: Files, databases, or services securely accessed by MCP servers

  5. Remote Services: External internet-based APIs or services accessed by MCP servers

This separation of concerns makes MCP servers highly modular and maintainable.

So how does this all connect?

How The Components Work Together

Let’s understand this with a practical example:

Say you're using Cursor (an MCP host) to manage your project's budget. You want to update a budget report in Google Sheets and send a summary of the changes to your team via Slack.

  • Cursor (MCP host) initiates a request to its MCP client to update the budget report in Google Sheets and send a Slack notification.

  • The MCP client connects to two MCP servers: one for Google Sheets and one for Slack.

  • The Google Sheets MCP server interacts with the Google Sheets API (remote service) to update the budget report.

  • The Slack MCP server interacts with the Slack API (remote service) to send a notification.

  • MCP servers send responses back to the MCP client.

  • The MCP client forwards these responses to Cursor, which displays the result to the user.

This process happens seamlessly, allowing Cursor to integrate with multiple services through a standardized interface.

But understanding fundamentals is no use if one can’t build, so let’s get building!

How to Build an MCP Server

There are two ways to build an MCP Server: using the Python SDK or the JavaScript SDK. For simplicity, I will focus on the Python SDK.

So, like any other good dev, let’s create a separate work environment to isolate things.

1. Work Environment Setup

We start by creating a project directory.

Navigate to your working folder and create a folder named MCP, or u can use the terminal command:

mkdir mcp
cd mcp

Next, create a virtual environment using:

python -m venv devenv

Now activate the environment with:

# activates env
# Windows:
devenv\Scripts\activate

# Linux/Mac:
source devenv/bin/activate

Ensure you see (dotenv) in Front of the terminal cwd path.

Finally, install two libraries - MCP SDK, MCP CLI:

# install libraries
pip install mcp mcp[cli]

It might ask you permission to install, press y and once installed, we are done with setting up the environment

2. Writing the Server Code

Open the folder in any of your favourite editors of choice, create a new file called calculator.py, and write the following code:

# basic import 
from mcp.server.fastmcp import FastMCP
import math

# instantiate an MCP server client
mcp = FastMCP("Hello World")

# DEFINE TOOLS

#addition tool
@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return int(a + b)

# subtraction tool
@mcp.tool()
def subtract(a: int, b: int) -> int:
    """Subtract two numbers"""
    return int(a - b)

# multiplication tool
@mcp.tool()
def multiply(a: int, b: int) -> int:
    """Multiply two numbers"""
    return int(a * b)

#  division tool
@mcp.tool() 
def divide(a: int, b: int) -> float:
    """Divide two numbers"""
    return float(a / b)

# power tool
@mcp.tool()
def power(a: int, b: int) -> int:
    """Power of two numbers"""
    return int(a ** b)

# square root tool
@mcp.tool()
def sqrt(a: int) -> float:
    """Square root of a number"""
    return float(a ** 0.5)

# cube root tool
@mcp.tool()
def cbrt(a: int) -> float:
    """Cube root of a number"""
    return float(a ** (1/3))

# factorial tool
@mcp.tool()
def factorial(a: int) -> int:
    """factorial of a number"""
    return int(math.factorial(a))

# log tool
@mcp.tool()
def log(a: int) -> float:
    """log of a number"""
    return float(math.log(a))

# remainder tool
@mcp.tool()
def remainder(a: int, b: int) -> int:
    """remainder of two numbers divison"""
    return int(a % b)

# sin tool
@mcp.tool()
def sin(a: int) -> float:
    """sin of a number"""
    return float(math.sin(a))

# cos tool
@mcp.tool()
def cos(a: int) -> float:
    """cos of a number"""
    return float(math.cos(a))

# tan tool
@mcp.tool()
def tan(a: int) -> float:
    """tan of a number"""
    return float(math.tan(a))

# DEFINE RESOURCES

# Add a dynamic greeting resource
@mcp.resource("greeting://{name}")
def get_greeting(name: str) -> str:
    """Get a personalized greeting"""
    return f"Hello, {name}!"
    
 
 # execute and return the stdio output
 if __name__ == "__main__":
    mcp.run(transport="stdio")

Let’s take a moment to understand what's happening in the code.

  1. First, we imported the FastMCP server from the MCP package and the math module. The FastMCP Server manages connections, follows the MCP protocol, and routes messages.

  2. Next, we created an MCP server client and named it "Hello World".

  3. Then, we added tools @mcp.tool() and resources using @mcp.resource(). These tools help the server perform operations, and the resource provides personalized greetings. (talk about exposing your data to LLM)

  4. Lastly, we start the MCP server using @mcp.run(), and the setup, which allows communication via standard input/output (stdio).

Hopefully, you will clearly understand what the code is doing now!

Now let’s test it using MCP Inspector

3. Running & Testing the Server Locally

MCP Inspector is a handy GUI tool that lets you test your custom MCP server without integrating it with LLM / AI agents. Let’s set it up.

Open the terminal and ensure you are in the working environment. Then type the following command:

mcp dev server.py

If you haven’t installed CLI in the previous section, you will be prompted to do so. You can either do it manually or press y again.

Once done, rerun the command, which will display a localhost URL.

Open it and press Connect:

Connecting MCP Inspector to the server.


Click on “List Templates,” select the displayed one, add your name, click “Read Resources,” and check out the output.

Now let’s test the tools. I am going to test one of them, though you are free to do so.

Head to the Tools tab in the navbar, click “List Tools” → select your desired one → Input values and press “Run Tool”. You will see the output.

Note: In case you encounter the Pydantic Error:

Error executing tool subtract: 2 validation errors for subtractArguments
a
  Field required [type=missing, input_value={}, input_type=dict]
    For further information visit <https://errors.pydantic.dev/2.10/v/missing>
b
  Field required [type=missing, input_value={}, input_type=dict]
    For further information visit <https://errors.pydantic.dev/2.10/v/missing>

You can delete both values and enter a different value. This is one bug with the tool, and it may have been done deliberately to reduce misuse.

With this, we are now done with testing.

However, the real power of MCP lies with the integration of IDEs / Agents. Let’s look at how to connect them.

Connecting Custom Servers to Cursor

I will use Cursor for demonstration purposes, as integration is straightforward.

Head over to your current working directory (cwd) and open the folder within Cursor. Your file explorer should look something like this 👇

Once in the folder, activate the virtual environment we made in the previous steps. (optional but suggested)

Next, create a new folder.cursor& inside it mcp.jsonand fill in the details as:

{
    "mcpServers": {
      "calculator": {
        "command": "C:\\Users\\harsh\\OneDrive\\Documents\\HARSH-IMPORTANT-FILES\\Composio\\mcp\\.venv\\Scripts\\python.exe",
        "args": ["C:\\Users\\harsh\\OneDrive\\Documents\\HARSH-IMPORTANT-FILES\\Composio\\mcp\\calculator_server.py"]
      }
    }
  }

Once done, the Cursor will automatically detect the defined MCP server. Hit enable on the prompt that appears.

For confirmation, head to Settings → Search MCP → MCP Tools & ensure the server shows 🟢 calculator:

Behind the scenes, we are just defining a schema where important bits are:

Name: The name of the server, which I am calling 'calculator'.

Command & Args: Here, you need to provide the command that will run the server from. It follows the absolute path format:

/path/to/your/venv/bin/python /path/to/your/file.py

In my case, this maps to:

# Commands
C:\\Users\\harsh\\OneDrive\\Documents\\HARSH-IMPORTANT-FILES\\Composio\\mcp\\.venv\\Scripts\\python.exe

# argument
C:\\Users\\harsh\\OneDrive\\Documents\\HARSH-IMPORTANT-FILES\\Composio\\mcp\\calculator_server.py

Ignore the \\\\ - window convention for handling escape character. For Linux / Mac, use the native file path convention!

If you are curious what each parameter means and what it does, check out the cursor mcp docs - Using mcp.json section.


To check the functionality, head to the composer, select Agent and write the following prompt and hit enter:

You will see it automatically retrieves the add tool under the alias mcp_add() . This means the cursor is now connected with the server.

Here is a small demo of testing server tools in the cursor (only supported functionality). - old demo as process remains the same

So far, so good, but these are just toy examples. What if you have to work on some advanced projects and use multiple different servers/tools? You'd need to write numerous lines of code for multiple tools, right?

Let’s look at a simpler alternative and how its one-liner integrations simplify workflow.

Enters Composio!

Composio in a Nutshell

Composio is the ultimate integration platform, empowering developers to seamlessly connect AI agents with external tools, servers, and APIs with just a single line of code.

With the fully managed MCP Servers, developers can rapidly build powerful AI applications without the hassle of managing complex integrations. We take care of the infrastructure so you can focus on innovation.

Let’s dive into how you can integrate Composio MCP into your workflow effortlessly!

Composio MCP Integration

Integrating with Composio MCP is incredibly simple and can be done in just five steps:

Integrating with Composio MCP is incredibly simple and can be done in just five steps:

  1. Visit the Composio MCP Directory page

  2. Select the Tools you need, keep an eye on the following:

    • Name: Name of tool / Server

    • Description: What the tool does

    • Images: Compatibility (as of now, Windsurf isn’t available for Windows)

  3. Go to the Installation Steps section on the next page and hit Generate. Copy the generated command (private info). Ensure you read all the available functions in the Available Actions section.

  4. Head to the terminal and paste the command, if prompted, press y and once done, restart

  5. Open the cursor and navigate to Settings → Search MCP → MCP Tools. Ensure the server shows 🟢 beside any MCP server. Feel free to change the name

& you are done!

For reference, here is a sample integration with Google Drive, Sheets & Docs:

To test the integration, go to the Composer, initiate a connection with the app, and ask it to perform actions.

Let’s look at an advanced integration to see where composio-mcp shines.

Linear ticket Management with Slack Collaboration.

Composio can handle complex use cases effortlessly. Let’s demonstrate how Composio solves the following challenge seamlessly:

Development teams often struggle to manage product-related issues, as this requires constant back-and-forth between the IDE and team Slack channels.

Develop an agent that handles all the operations through the IDE. This way, teams can stay in sync without unnecessary context switching, dramatically increasing productivity.

Let’s use composio-mcp for this one!

Follow the steps one after another:

  1. Head to the MCP Repository and select Linear & Slack integrations. If you don’t find them listed, use the search console.

  2. Generate a cursor / windsurf URL and paste it into the terminal, prompt y of needed

  3. Open the cursor and integrate it with the method covered in the above section.

If you are experiencing any issues, please refer to the sample video of the integration for guidance. 👇

Integrating Linear & Slack in Cursor.

Ok, now let’s see if it works as expected.

  • Head to the cursor chat and select Agent.

  • Initiate an OAuth connection by writing “create a connection with Slack”. Do the same for Linear

  • Head to the generated URL and authenticate. Make sure to review the permission!

  • Once done, return to the cursor and verify if the connection is active. Here is a sample video (steps remain the same, with a new ui also)

I used a simple prompt to create a linear issue and send a message about it in a Slack channel.

Prompt: Create a Linear issue under a given project, change the label to “TODO,” add a comment under the problem, and once everything is done, message about the issue creation status on a Slack channel.

Composio MCP’s seamless integration connected a complex workflow without writing a single line of code.

We have now reached the end of the article; however, before concluding, we would like to share some final thoughts.

Conclusion

As AI transforms software development, MCP will play an increasingly important role in creating seamless, integrated experiences.

Whether you're building custom MCP servers or leveraging pre-built solutions like Composio MCP, the protocol offers a powerful way to enhance AI capabilities through external tools and data sources.

The future of AI isn't just about smarter models - it's about creating ecosystems where AI can seamlessly interact with the tools we use every day. MCP is a crucial step toward that future.

I hope you had a great learning experience—happy building with Composio! 🚀

As AI continues to revolutionise software development, integrating it within workflow using IDEs like Cursor and Windsurf is becoming normal for developers. However, there is still a pain point: integrating tools, external services like APIs, and local data with IDEs/AI.

Although methods like Function Calling, Tool Calling, and RAG exist, they are often painful, time-consuming, and require domain knowledge. What if this process could be simplified?

A game changer, right?

The Model Context Protocol (MCP) does just that without breaking a sweat💧. So, what is it, how to use it, how to integrate MCP in an IDE, and what are some advanced use cases of MCP?

Let’s find out!

What is MCP

Think of MCP as a USB-C port on a laptop. With it, you can charge your computer, transfer data, connect to other displays, and charge other Type-C supported devices.

Similarly, the Model Context Protocol provides a standard, secure, real-time, two-way communication interface for AI systems to connect with external tools, API Services, and data sources.

This means that, unlike traditional API integration, which requires separate code, documentation, and maintenance, MCP can provide a single, standardised way for AI models to interact with external systems. You write code once, and all AI systems can use it.

The key differences between MCP and traditional APIs include:

Feature

Model Context Protocol (MCP)

Traditional API (REST / GraphQL / gRPC)

Primary purpose

Give LLM-based agents a single way to fetch context and invoke side-effecting tools.

General machine-to-machine data exchange & business logic.

Integration effort

Once an agent speaks MCP, it can talk to any compliant server; only one SDK/wire-spec to learn.

Each API exposes its own spec/SDK; you integrate them one by one.

Interaction model

Stateful sessions + bidirectional messaging; supports long-running tasks and mid-job progress callbacks.

Stateless request/response; usually unidirectional.

Streaming support

Standardised via “Streamable HTTP” (SSE/WebSocket).

Not part of the REST spec; developers bolt on WebSockets/SSE ad hoc.

Extensibility (adding new capabilities)

The server can add new tools/resources without breaking clients; the agent discovers them at runtime.

Breaking changes need versioning, or clients must update to use new endpoints/types.

Standardisation/wire format

One JSON-Schema-driven spec for inputs & outputs, plus defined transports.

Multiple styles (REST, GraphQL, gRPC) with differing auth headers, error shapes, and media types.

Maturity & tooling

Rapidly growing, but still early; dozens of open-source servers and early commercial support.

Decades of best-practice guides, gateways, SDKs, APM, and monitoring.

Performance path length

Extra hop (agent → MCP → underlying API) adds a bit of latency; streaming mitigates waiting for large payloads.

Direct call; generally lower overhead for high-QPS, deterministic workloads.

Typical sweet-spot use-cases

Autonomous agents chaining multiple tools, dynamic workflows, and user-in-the-loop

CRUD data services, stable integrations, high-throughput micro-services.

MCP enables two-way communication, allowing AI models to retrieve information and dynamically trigger actions. This makes it perfect for creating more intelligent and context-aware applications. Check out this blog on Model Context Protocol for a full breakdown.

So, how does this all work?

MCP Components

The MCP architecture consists of several key components that work together to enable seamless integration:

  1. MCP Hosts: These are applications (like Claude Desktop or AI-driven IDEs) that need access to external data or tools

  2. MCP Clients: They maintain dedicated, one-to-one connections with MCP servers.

  3. MCP Servers: Lightweight servers that expose specific functionalities via MCP, connecting to local or remote data sources.

  4. Local Data Sources: Files, databases, or services securely accessed by MCP servers

  5. Remote Services: External internet-based APIs or services accessed by MCP servers

This separation of concerns makes MCP servers highly modular and maintainable.

So how does this all connect?

How The Components Work Together

Let’s understand this with a practical example:

Say you're using Cursor (an MCP host) to manage your project's budget. You want to update a budget report in Google Sheets and send a summary of the changes to your team via Slack.

  • Cursor (MCP host) initiates a request to its MCP client to update the budget report in Google Sheets and send a Slack notification.

  • The MCP client connects to two MCP servers: one for Google Sheets and one for Slack.

  • The Google Sheets MCP server interacts with the Google Sheets API (remote service) to update the budget report.

  • The Slack MCP server interacts with the Slack API (remote service) to send a notification.

  • MCP servers send responses back to the MCP client.

  • The MCP client forwards these responses to Cursor, which displays the result to the user.

This process happens seamlessly, allowing Cursor to integrate with multiple services through a standardized interface.

But understanding fundamentals is no use if one can’t build, so let’s get building!

How to Build an MCP Server

There are two ways to build an MCP Server: using the Python SDK or the JavaScript SDK. For simplicity, I will focus on the Python SDK.

So, like any other good dev, let’s create a separate work environment to isolate things.

1. Work Environment Setup

We start by creating a project directory.

Navigate to your working folder and create a folder named MCP, or u can use the terminal command:

mkdir mcp
cd mcp

Next, create a virtual environment using:

python -m venv devenv

Now activate the environment with:

# activates env
# Windows:
devenv\Scripts\activate

# Linux/Mac:
source devenv/bin/activate

Ensure you see (dotenv) in Front of the terminal cwd path.

Finally, install two libraries - MCP SDK, MCP CLI:

# install libraries
pip install mcp mcp[cli]

It might ask you permission to install, press y and once installed, we are done with setting up the environment

2. Writing the Server Code

Open the folder in any of your favourite editors of choice, create a new file called calculator.py, and write the following code:

# basic import 
from mcp.server.fastmcp import FastMCP
import math

# instantiate an MCP server client
mcp = FastMCP("Hello World")

# DEFINE TOOLS

#addition tool
@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return int(a + b)

# subtraction tool
@mcp.tool()
def subtract(a: int, b: int) -> int:
    """Subtract two numbers"""
    return int(a - b)

# multiplication tool
@mcp.tool()
def multiply(a: int, b: int) -> int:
    """Multiply two numbers"""
    return int(a * b)

#  division tool
@mcp.tool() 
def divide(a: int, b: int) -> float:
    """Divide two numbers"""
    return float(a / b)

# power tool
@mcp.tool()
def power(a: int, b: int) -> int:
    """Power of two numbers"""
    return int(a ** b)

# square root tool
@mcp.tool()
def sqrt(a: int) -> float:
    """Square root of a number"""
    return float(a ** 0.5)

# cube root tool
@mcp.tool()
def cbrt(a: int) -> float:
    """Cube root of a number"""
    return float(a ** (1/3))

# factorial tool
@mcp.tool()
def factorial(a: int) -> int:
    """factorial of a number"""
    return int(math.factorial(a))

# log tool
@mcp.tool()
def log(a: int) -> float:
    """log of a number"""
    return float(math.log(a))

# remainder tool
@mcp.tool()
def remainder(a: int, b: int) -> int:
    """remainder of two numbers divison"""
    return int(a % b)

# sin tool
@mcp.tool()
def sin(a: int) -> float:
    """sin of a number"""
    return float(math.sin(a))

# cos tool
@mcp.tool()
def cos(a: int) -> float:
    """cos of a number"""
    return float(math.cos(a))

# tan tool
@mcp.tool()
def tan(a: int) -> float:
    """tan of a number"""
    return float(math.tan(a))

# DEFINE RESOURCES

# Add a dynamic greeting resource
@mcp.resource("greeting://{name}")
def get_greeting(name: str) -> str:
    """Get a personalized greeting"""
    return f"Hello, {name}!"
    
 
 # execute and return the stdio output
 if __name__ == "__main__":
    mcp.run(transport="stdio")

Let’s take a moment to understand what's happening in the code.

  1. First, we imported the FastMCP server from the MCP package and the math module. The FastMCP Server manages connections, follows the MCP protocol, and routes messages.

  2. Next, we created an MCP server client and named it "Hello World".

  3. Then, we added tools @mcp.tool() and resources using @mcp.resource(). These tools help the server perform operations, and the resource provides personalized greetings. (talk about exposing your data to LLM)

  4. Lastly, we start the MCP server using @mcp.run(), and the setup, which allows communication via standard input/output (stdio).

Hopefully, you will clearly understand what the code is doing now!

Now let’s test it using MCP Inspector

3. Running & Testing the Server Locally

MCP Inspector is a handy GUI tool that lets you test your custom MCP server without integrating it with LLM / AI agents. Let’s set it up.

Open the terminal and ensure you are in the working environment. Then type the following command:

mcp dev server.py

If you haven’t installed CLI in the previous section, you will be prompted to do so. You can either do it manually or press y again.

Once done, rerun the command, which will display a localhost URL.

Open it and press Connect:

Connecting MCP Inspector to the server.


Click on “List Templates,” select the displayed one, add your name, click “Read Resources,” and check out the output.

Now let’s test the tools. I am going to test one of them, though you are free to do so.

Head to the Tools tab in the navbar, click “List Tools” → select your desired one → Input values and press “Run Tool”. You will see the output.

Note: In case you encounter the Pydantic Error:

Error executing tool subtract: 2 validation errors for subtractArguments
a
  Field required [type=missing, input_value={}, input_type=dict]
    For further information visit <https://errors.pydantic.dev/2.10/v/missing>
b
  Field required [type=missing, input_value={}, input_type=dict]
    For further information visit <https://errors.pydantic.dev/2.10/v/missing>

You can delete both values and enter a different value. This is one bug with the tool, and it may have been done deliberately to reduce misuse.

With this, we are now done with testing.

However, the real power of MCP lies with the integration of IDEs / Agents. Let’s look at how to connect them.

Connecting Custom Servers to Cursor

I will use Cursor for demonstration purposes, as integration is straightforward.

Head over to your current working directory (cwd) and open the folder within Cursor. Your file explorer should look something like this 👇

Once in the folder, activate the virtual environment we made in the previous steps. (optional but suggested)

Next, create a new folder.cursor& inside it mcp.jsonand fill in the details as:

{
    "mcpServers": {
      "calculator": {
        "command": "C:\\Users\\harsh\\OneDrive\\Documents\\HARSH-IMPORTANT-FILES\\Composio\\mcp\\.venv\\Scripts\\python.exe",
        "args": ["C:\\Users\\harsh\\OneDrive\\Documents\\HARSH-IMPORTANT-FILES\\Composio\\mcp\\calculator_server.py"]
      }
    }
  }

Once done, the Cursor will automatically detect the defined MCP server. Hit enable on the prompt that appears.

For confirmation, head to Settings → Search MCP → MCP Tools & ensure the server shows 🟢 calculator:

Behind the scenes, we are just defining a schema where important bits are:

Name: The name of the server, which I am calling 'calculator'.

Command & Args: Here, you need to provide the command that will run the server from. It follows the absolute path format:

/path/to/your/venv/bin/python /path/to/your/file.py

In my case, this maps to:

# Commands
C:\\Users\\harsh\\OneDrive\\Documents\\HARSH-IMPORTANT-FILES\\Composio\\mcp\\.venv\\Scripts\\python.exe

# argument
C:\\Users\\harsh\\OneDrive\\Documents\\HARSH-IMPORTANT-FILES\\Composio\\mcp\\calculator_server.py

Ignore the \\\\ - window convention for handling escape character. For Linux / Mac, use the native file path convention!

If you are curious what each parameter means and what it does, check out the cursor mcp docs - Using mcp.json section.


To check the functionality, head to the composer, select Agent and write the following prompt and hit enter:

You will see it automatically retrieves the add tool under the alias mcp_add() . This means the cursor is now connected with the server.

Here is a small demo of testing server tools in the cursor (only supported functionality). - old demo as process remains the same

So far, so good, but these are just toy examples. What if you have to work on some advanced projects and use multiple different servers/tools? You'd need to write numerous lines of code for multiple tools, right?

Let’s look at a simpler alternative and how its one-liner integrations simplify workflow.

Enters Composio!

Composio in a Nutshell

Composio is the ultimate integration platform, empowering developers to seamlessly connect AI agents with external tools, servers, and APIs with just a single line of code.

With the fully managed MCP Servers, developers can rapidly build powerful AI applications without the hassle of managing complex integrations. We take care of the infrastructure so you can focus on innovation.

Let’s dive into how you can integrate Composio MCP into your workflow effortlessly!

Composio MCP Integration

Integrating with Composio MCP is incredibly simple and can be done in just five steps:

Integrating with Composio MCP is incredibly simple and can be done in just five steps:

  1. Visit the Composio MCP Directory page

  2. Select the Tools you need, keep an eye on the following:

    • Name: Name of tool / Server

    • Description: What the tool does

    • Images: Compatibility (as of now, Windsurf isn’t available for Windows)

  3. Go to the Installation Steps section on the next page and hit Generate. Copy the generated command (private info). Ensure you read all the available functions in the Available Actions section.

  4. Head to the terminal and paste the command, if prompted, press y and once done, restart

  5. Open the cursor and navigate to Settings → Search MCP → MCP Tools. Ensure the server shows 🟢 beside any MCP server. Feel free to change the name

& you are done!

For reference, here is a sample integration with Google Drive, Sheets & Docs:

To test the integration, go to the Composer, initiate a connection with the app, and ask it to perform actions.

Let’s look at an advanced integration to see where composio-mcp shines.

Linear ticket Management with Slack Collaboration.

Composio can handle complex use cases effortlessly. Let’s demonstrate how Composio solves the following challenge seamlessly:

Development teams often struggle to manage product-related issues, as this requires constant back-and-forth between the IDE and team Slack channels.

Develop an agent that handles all the operations through the IDE. This way, teams can stay in sync without unnecessary context switching, dramatically increasing productivity.

Let’s use composio-mcp for this one!

Follow the steps one after another:

  1. Head to the MCP Repository and select Linear & Slack integrations. If you don’t find them listed, use the search console.

  2. Generate a cursor / windsurf URL and paste it into the terminal, prompt y of needed

  3. Open the cursor and integrate it with the method covered in the above section.

If you are experiencing any issues, please refer to the sample video of the integration for guidance. 👇

Integrating Linear & Slack in Cursor.

Ok, now let’s see if it works as expected.

  • Head to the cursor chat and select Agent.

  • Initiate an OAuth connection by writing “create a connection with Slack”. Do the same for Linear

  • Head to the generated URL and authenticate. Make sure to review the permission!

  • Once done, return to the cursor and verify if the connection is active. Here is a sample video (steps remain the same, with a new ui also)

I used a simple prompt to create a linear issue and send a message about it in a Slack channel.

Prompt: Create a Linear issue under a given project, change the label to “TODO,” add a comment under the problem, and once everything is done, message about the issue creation status on a Slack channel.

Composio MCP’s seamless integration connected a complex workflow without writing a single line of code.

We have now reached the end of the article; however, before concluding, we would like to share some final thoughts.

Conclusion

As AI transforms software development, MCP will play an increasingly important role in creating seamless, integrated experiences.

Whether you're building custom MCP servers or leveraging pre-built solutions like Composio MCP, the protocol offers a powerful way to enhance AI capabilities through external tools and data sources.

The future of AI isn't just about smarter models - it's about creating ecosystems where AI can seamlessly interact with the tools we use every day. MCP is a crucial step toward that future.

I hope you had a great learning experience—happy building with Composio! 🚀

Done with setup? Now learn how to make your MCP agents smarter with tools and prompts.

Done with setup? Now learn how to make your MCP agents smarter with tools and prompts.

Done with setup? Now learn how to make your MCP agents smarter with tools and prompts.

mcp, server, stepbystep, guide, building, from, scratch