FlowMCP Server

by FlowMCP

205 downloads
Not rated
GitHub

About

Provides local and remote servers to run FlowMCP schemas via stdio or HTTP/SSE for AI–API integration.

Details

Author
FlowMCP
Downloads
205
Categories
Other

- Lightweight local server using stdin/stdout with no extra dependencies
- Remote server supporting three transport protocols: SSE, stickyStreamable, statelessStreamable
- Optional Bearer token authentication for remote endpoints
- Configurable server metadata (name, description, version) via setConfig
- Compatible with FlowMCP framework and SchemaImporter for schema activation

Install the package (flowmcp-server), create a LocalServer or RemoteServer instance, prepare schema activations with FlowMCP.prepareActivations(...), add them via addActivationPayloads(...), then call start(). See the code examples in the README for local and remote configurations.

FlowMCP Server

This repository provides two server implementations compatible with the FlowMCP framework:

🖥 LocalServer — for local, stdio-based execution
🌐 RemoteServer — for network-based usage via HTTP and SSE

---

🖥 Local Server

The LocalServer is designed for local workflows, using standard input/output streams. It is ideal for CLI tools, testing, and development environments.

✅ Features

Lightweight and dependency-free I/O via stdin/stdout
Fully supports FlowMCP.activateServerTools(...)
Uses StdioServerTransport

🚀 Example Usage

import { LocalServer } from 'flowmcp-server'
import { FlowMCP } from 'flowmcp'
import { SchemaImporter } from 'schemaimporter'

const schemaList = await SchemaImporter.get({ withSchema: true })
const arrayOfSchemas = schemaList.map(({ schema }) => schema)

const { activationPayloads } = FlowMCP.prepareActivations({ arrayOfSchemas })

const localServer = new LocalServer({ silent: true })
localServer.addActivationPayloads({ activationPayloads })

await localServer.start()

🔧 Configuration

localServer.setConfig({
  overwrite: {
    serverDescription: {
      name: 'My Local Server',
      description: 'CLI test server',
      version: '1.2.2'
    }
  }
})

---

🌐 Remote Server

The RemoteServer provides HTTP-based access to FlowMCP schemas using various protocols. It is ideal for frontend apps, remote agents, and networked integrations.

✅ Features

Supports 3 transport protocols:

statelessStreamable
stickyStreamable
sse (Server-Sent Events)
Optional Bearer token authentication
Multiple routes and schemas can be activated
Easily configurable

🚀 Example Usage

import { RemoteServer } from 'flowmcp-server'
import { FlowMCP } from 'flowmcp'

const remoteServer = new RemoteServer({ silent: true })

const { activationPayloads } = FlowMCP.prepareActivations({
arrayOfSchemas: [...],
envObject: process.env,
activateTags: ['example.route']
})

await remoteServer.addActivationPayloads({
routePath: '/api',
activationPayloads,
transportProtocols: ['sse', 'stickyStreamable'],
bearer: 'mysecrettoken'
})

remoteServer.start()

🔧 Configuration

remoteServer.setConfig({
  overwrite: {
    port: 8081,
    rootUrl: 'http://mydomain.com'
  }
})

📡 Supported Transport Protocols

| Protocol | Description |
| --------------------- | ----------------------------------------- |
| sse | Server-Sent Events, persistent connection |
| stickyStreamable | HTTP with reusable sessions (via headers) |
| statelessStreamable | Stateless POST-based HTTP communication |

---

🔐 Authentication (Optional)

When the bearer option is set, incoming requests must include the following header:

Authorization: Bearer <TOKEN>

Invalid or missing tokens will result in 401 Unauthorized or 403 Forbidden responses.

---

📌 Compatibility

FlowMCP Server version: 1.2.0+
FlowMCP Schema spec version: 1.2.2

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.