FastMCP helps developers turn Python functions into tools an AI app can call through the Model Context Protocol (MCP). For an employee asking about sales, that can remove the recurring step of exporting a report and pasting it into chat. A developer first has to connect the data, define the calculation and enforce access. FastMCP quickstart.

A sales question and a concrete answer

Show October’s online-store net sales and order count, and compare them with September.

Imagine an approved AI app connected to a company’s sales-summary tool. These invented figures illustrate the answer it could prepare; they are not results from a company account or a FastMCP deployment.

Swipe or scroll horizontally to view all columns.

Fictional online-store totals, in Korean won
Metric September 2026 October 2026 Change
Net sales KRW 10,000,000 KRW 12,000,000 +20%
Paid orders 200 240 +20%

A useful answer would say: “October recorded KRW 12 million in net sales across 240 paid orders. Both increased 20% from September.” It should also show the reporting basis, so someone can reconcile it with the original report.

How these fictional totals are counted

Orders are grouped by order date. Each month runs from midnight on its first day to, but not including, midnight on the next month’s first day, in Korea Standard Time (UTC+9). The snapshot is November 1, 2026, at 00:00 KST. Net sales means discounted merchandise amounts for that month’s paid, non-cancelled orders, minus refunds against those orders recorded before the snapshot; tax and shipping are excluded. Each qualifying order counts once, even if later refunded. These are example rules, not a universal accounting definition.

What MCP and FastMCP each do

MCP is the common communication protocol between an AI application’s client and an external server. The server advertises available tools and accepts calls to them. FastMCP is a Python framework for building that server and its tools. It is neither the AI model nor the sales database. MCP architecture.

The distinction explains two benefits: MCP provides a shared interface for compatible clients; FastMCP helps the developer implement it. Each AI app still needs a supported connection method and its own connection and authentication setup. Compatibility does not automatically grant access to company records.

A sales question passes from an employee to an AI app, then to an approved reporting tool; the server returns fictional October totals of KRW 12 million and 240 orders.
Illustrative workflow by AI Tool Radar. The team supplies the query, data connection and permissions; FastMCP exposes the tool. Figures are fictional.

How the question reaches the database

The example tool is get_sales_summary. It accepts a month and a channel. An October request carries {"month":"2026-10","channel":"online_store"}; September uses the same tool with 2026-09.

  1. The AI app sends the selected tool’s name and arguments to the server.
  2. The team’s server code checks the month and channel, verifies which records the caller may access, and runs the approved reporting query within that scope. The developer implements these business permissions; adding FastMCP alone does not establish them.
  3. The tool returns the totals with currency, reporting period, snapshot and data status. The AI uses both months to prepare the comparison.

In this design, the model supplies values for a fixed query; it cannot submit arbitrary SQL. A developer binds those values into a predefined SELECT, following the database driver’s parameter rules. Python’s SQLite documentation explains parameter binding.

A missing report must return a “no data” status, not zero sales. A complete report with no orders can legitimately return zero. If September is missing or its comparison value is zero, the answer should withhold that percentage. Here, the calculation is (12,000,000 - 10,000,000) / 10,000,000 × 100 = 20%; order growth uses the same formula.

Three ways to do the same job

Swipe or scroll horizontally to view all columns.

All three approaches can produce the same sales comparison
Approach Who moves the data? When it fits
Manual report transfer An employee retrieves both months, selects the permitted figures and pastes or uploads them. An occasional question, especially when the report already exists.
Existing API or custom integration The application calls an approved reporting function and passes its result to the model. A working integration, or an app whose own API and model SDK already cover the task.
A tool built with FastMCP An MCP client calls the server’s approved sales function. A team wants to expose Python business tools to compatible MCP clients and can maintain the server.

A correct existing report can produce the same totals. FastMCP gives the team a repeatable path from a question to its agreed sales calculation. Keep an integration that already meets the team’s needs. If you are building an AI feature behind your own app’s API, the Langflow app-integration guide covers that different starting point.

What employees and builders gain

Once the connection works, an employee can request another permitted month without exporting another file. They still check the period, freshness and explanation before using the answer. A total alone cannot explain why sales changed.

For the builder, FastMCP derives the tool’s input schema from the function signature and type annotations, uses its description, and handles argument validation. The business query stays in the developer’s function. Tool definitions. Its client can also exercise a server in memory, which helps check inputs and returned values before connecting an AI app. Client and testing options.

The official MCP Python SDK also provides high-level tool registration and derives schemas from Python functions. FastMCP is a framework choice, not a requirement for avoiding handwritten protocol messages. Developers should compare their existing SDK and maintenance needs before switching. Official SDK first steps.

What the team must prepare

Assign a developer to maintain the query and server. Use a database account limited to the required reporting view, and enforce each user’s permitted data scope. Database privileges remain a separate control from the MCP connection. PostgreSQL’s privilege model illustrates that distinction.

FastMCP’s OAuth-based authorization checks apply to HTTP connections. Local stdio connections rely on the local execution environment; those checks are skipped there. Configure the chosen deployment deliberately. FastMCP authorization.

Return only the aggregates needed for the question. Even with a locally running server, a cloud AI app may send returned figures to its model provider. Hosting location and inference location are separate choices; review the chosen app’s data policy. The local-model and cloud-API guide explains that decision.

The current Python package requires Python 3.11 or newer and uses the Apache 2.0 license. Budget separately for development, hosting and any paid AI app or model usage; an open-source library does not cover those costs. Package requirements and license.

Could the same idea work for Drive or Notion?

Yes, a custom tool could call a document service’s API, but first check whether an approved connector already handles the job. Search capabilities depend on that service: Drive API search supports file-name and fullText conditions with documented matching rules. Notion’s REST search endpoint searches page and data-source titles within the connection’s access; it is not a general search of page bodies. The official Notion MCP has its own search and reading tools. Wrapping an API in FastMCP does not expand that API’s search coverage.

← Back to Tech Guides
Tech Guides
Turn a PDF Into Editable Markdown With Docling ↗