> ## Documentation Index
> Fetch the complete documentation index at: https://docs-preprod.sambanova.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Fast MCP

## Overview

**FastMCP** is a high-level python framework for building Model Context Protocol (MCP) clients and servers with minimal boilerplate. Whether you're developing tools that interact with language models or integrating external APIs via MCP, FastMCP simplifies the process with clean Python syntax and robust features.

This guide walks you through integrating FastMCP with **SambaCloud**—letting you build custom MCP servers or connect to existing ones, enabling advanced orchestration, agent tooling, and function-calling use cases.

## Prerequisites

* A [SambaCloud](https://cloud.sambanova.ai) account
* An API key from your SambaNova dashboard
* Python 3.8 or later
* Familiarity with Python virtual environments and terminal basics

## Installation

1. Set up a virtual environment

<CodeGroup>
  ```filename
  python -m venv .venv
  source .venv/bin/activate
  ```
</CodeGroup>

2. Install required packages

<CodeGroup>
  ```filename
  pip install openai
  pip install mcp
  ```
</CodeGroup>

<Note>
  `openai` is used for compatibility with OpenAI-compatible APIs, including SambaNova’s API endpoints.
</Note>

## Usage

You can use FastMCP to either:

* Start a custom MCP server
* Connect to an existing server (like one powered by a SambaNova model)

Here’s a minimal example using a SambaNova-compatible model:

<CodeGroup>
  ```filename
  from mcp.server.fast import FastMCPServer

  app = FastMCPServer(model="sambanova/falcon-rw-7b-instruct")

  @app.tool()
  def get_weather(location: str) -> str:
      return f"The weather in {location} is sunny."

  app.run()
  ```
</CodeGroup>

<Note>
  `@app.tool()` is a decorator that exposes functions as callable tools via MCP. You can register multiple tools and handle complex inputs with type annotations.
</Note>

## Use Cases

* Enable tool use and function calling with SambaNova models
* Build multi-agent systems and orchestration frameworks
* Integrate external APIs and tools into LLM workflows
* Serve lightweight custom agents with decorator-based handlers

## Resources

* [MCP SambaNova examples](https://github.com/sambanova/integrations/blob/main/mcp/mcp_sambanova_examples.ipynb)
* [FastMCP documentation](https://gofastmcp.com/getting-started/welcome)
