mcp-demo

mcp-demo

3.4

This repository demonstrates the minimal example of MCP client and remote server implementations without relying on official or 3rd party MCP SDKs.

The Remote Model Context Protocol (MCP) Server is a demonstration of implementing MCP client and server without using official or third-party SDKs. It adheres to the Model Context Protocol specification, focusing on the low-level details of MCP flow, including authentication and authorization via OAuth2.1. This setup is particularly useful for enterprise software that cannot use MCP SDKs due to existing server stacks and business logic. The demo uses Streamable HTTP for remote MCP Server implementation, allowing the unification of data and MCP servers. The backend is written in Python, and the frontend in Vue.js, but the logic can be adapted to other languages. The demo supports OAuth2.1 flow with PKCE, and the frontend acts as both MCP Host and Client, while the backend serves as MCP Server and Local Data Source. The remote MCP server is preferred over a local one for reasons such as backward compatibility, extensibility, maintainability, classification, and telemetry.

Features

  • OAuth2.1 flow with PKCE support
  • Streamable HTTP for remote MCP Server
  • Separation of local and remote context handling
  • Unification of data server and MCP server
  • Adaptable to various programming languages

Usage with Different Platforms

python_backend

python
# Example script to run the backend server
from backend import app

if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000)

vue_frontend

javascript
// Example script to run the frontend server
import { createApp } from 'vue';
import App from './App.vue';

createApp(App).mount('#app');