mcpField
M
Model Context Protocol (MCP) Server

Model Context Protocol (MCP) Server

Local
github.com/AyushRatan1Developer Tools0Updated 80w ago

About Model Context Protocol (MCP) Server

Model Context Protocol (MCP) Server is a FastAPI server that doubles numerical inputs and supports session management and API-key authentication. Its README also describes Excel VBA and Office Scripts integration.

Key features

  1. 01Doubles numerical inputs
  2. 02Session IDs for request state
  3. 03Optional API-key authentication
  4. 04Excel VBA and Office Scripts integration
  5. 05CORS middleware

Use cases

  1. 01Double a list of values sent from a client
  2. 02Keep session state across requests during a server run
  3. 03Call the endpoint from Excel VBA or Office Scripts

MCP support

The server exposes a POST endpoint at /mcp/process that accepts a list of numbers and returns doubled values. Requests can include a session_id and api_key.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

Model Context Protocol (MCP) Server

A simple MCP server built with FastAPI that processes numerical inputs by doubling them, with support for session management and API key authentication.

Setup

  1. Install the required dependencies:
pip install -r requirements.txt
  1. Start the server:
uvicorn main:app --reload

The server will be running at http://localhost:8000

API Endpoints

POST /mcp/process

Processes a list of numerical inputs by doubling each value.

Request Body:

{
  "inputs": [1.0, 2.0, 3.0]
}

Headers (optional):

  • session_id: To maintain state between requests
  • api_key: For authentication (demo key: "demo_key")

Response:

{
  "outputs": [2.0, 4.0, 6.0],
  "session_id": "generated-session-id"
}

Excel VBA Integration

You can use the following VBA code to integrate with the MCP server from Excel:

Sub CallMCPServer()
    ' Define the input range
    Dim inputRange As Range
    Set inputRange = Range("A1:A3")
    
    ' Create an HTTP request
    Dim request As Object
    Set request = CreateObject("MSXML2.XMLHTTP")
    
    ' Prepare JSON data
    Dim jsonData As String
    jsonData = "{""inputs"": ["
    
    Dim cell As Range
    Dim first As Boolean
    first = True
    
    For Each cell In inputRange
        If Not first Then
            jsonData = jsonData & ", "
        End If
        jsonData = jsonData & cell.Value
        first = False
    Next cell
    
    jsonData = jsonData & "]}"
    
    ' Send the request
    request.Open "POST", "http://localhost:8000/mcp/process", False
    request.setRequestHeader "Content-Type", "application/json"
    request.send jsonData
    
    ' Handle the response
    If request.Status = 200 Then
        Dim response As Object
        Set response = ParseJson(request.responseText)
        
        ' Display the outputs
        Dim outputStr As String
        outputStr = "Processed outputs: " & vbCrLf
        
        Dim i As Integer
        For i = 1 To response.Item("outputs").Count
            outputStr = outputStr & response.Item("outputs").Item(i) & vbCrLf
        Next i
        
        MsgBox outputStr, vbInformation, "MCP Server Response"
        
        ' Optionally store the session ID for future requests
        Dim sessionId As String
        sessionId = response.Item("session_id")
    Else
        MsgBox "Error: " & request.Status & " - " & request.responseText, vbExclamation
    End If
End Sub

Function ParseJson(jsonString As String) As Object
    ' This is a simplified JSON parser for demo purposes
    ' For production use, consider a proper JSON library
    Dim ScriptEngine As Object
    Set ScriptEngine = CreateObject("ScriptControl")
    ScriptEngine.Language = "JScript"
    
    Dim JsonCode As String
    JsonCode = "JSON.parse('" & Replace(jsonString, "'", "\'") & "');"
    
    Set ParseJson = ScriptEngine.Eval(JsonCode)
End Function

For modern Excel with Office Scripts, you can use JavaScript/TypeScript with fetch API to make HTTP requests to the MCP server.

Notes

  • The server includes CORS middleware to allow cross-origin requests from web-based Excel clients
  • Session state is stored in memory and will be lost if the server restarts
  • For production use, consider using a database for session storage and proper authentication

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.