Urgent.News

What's breaking now, across thousands of outlets.

Tech

Building an MCP Server for Your Django App: What We Learned Doing It for Real

MCP — the Model Context Protocol — has gone from a niche Anthropic spec to something every AI-forward team is talking about. The pitch is simple: instead of writing custom tool integrations for every agent you build, you expose your application's capabilities as an MCP server, and any MCP-compatible client (Claude, Cursor, your own agent) can use them. We have been building MCP servers for client…

MCP — the Model Context Protocol — has become a focal point for AI-forward teams. It allows developers to expose their application's capabilities as an MCP server, enabling any MCP-compatible client to utilize these tools. The team behind this post has been building MCP servers for client Django applications and shares their insights on the process.

MCP offers a standardized method to provide tools, resources, and prompts to AI clients via a defined protocol (JSON-RPC over stdio or HTTP/SSE). Instead of creating unique function-calling schemas for different AI platforms, developers can utilize a single MCP server that accommodates all compatible clients. However, it's important to note that MCP doesn't provide security measures, access control, rate limiting, or business logic. These components must still be implemented on top of the standard protocol.

For teams working on multiple agents or those looking to integrate their internal tools with off-the-shelf AI clients, the standardization provided by MCP can significantly simplify the development process. A Django MCP server is essentially a standalone process that communicates with the Django application, importing Django models and services without being tied to Django views. The server is built using the mcp Python SDK.

To implement the server, developers define tools and their corresponding input and output schemas using Pydantic models. In this case, two tools are created: 'get_order' and 'update_order_status'. The 'get_order' tool retrieves full details for a specific order, including line items, status history, and customer information. The 'update_order_status' tool allows updating the status of an order, with valid statuses and a requirement for a reason when cancelling.

Upon receiving a request, the server checks the tool name and processes the corresponding input arguments. If the requested tool is available, the server executes the associated function, retrieves the necessary data from the Django models, and returns the result as a list of TextContent objects. If the tool is unknown, the server returns an appropriate error message.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

iFixit Shares iPhone 18 Pro Teardown With Inside Look at New Features

iFixit today published an iPhone 18 Pro and iPhone 18 Pro Max teardown in both article and video formats, providing a closer look inside the new devices. The teardown confirms the battery capacities for the eSIM-only models: iPhone 18 Pro: 4,288 mAh (+0.8% vs. 4,252 mAh for iPhone 17 Pro) iPhone 18 Pro Max: 5,567 mAh (+9.4% vs.

Aspera Eureka: The Bengaluru Cargo Plane That Lands on Water and Targets Under $1 per Tonne-Km

Verdict: Aspera Industries, a Bengaluru startup founded in June 2025, has unveiled Eureka, an autonomous amphibious cargo aircraft that takes off and lands on water, carries 1,000 kg over a stated…

  • Aspera Industries launches Eureka, autonomous amphibious cargo plane.
  • Eureka features retractable hydrofoils for water takeoff/landing.
  • Targeted at New Zealand, Australia, Southeast Asia, and India.

More from Monday 21 September →