examples/

directory
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2025 License: Apache-2.0

README

Cortex Examples

This directory contains example applications that demonstrate how to use the Cortex MCP server platform in various scenarios.

Server Examples

These examples showcase different server configurations and communication protocols:

  • stdio-server: A simple stdio-based MCP server example
  • sse-server: An HTTP/SSE-based MCP server example
  • multi-protocol: A server that supports both stdio and HTTP protocols

Integration Examples

The integration directory contains examples of embedding Cortex in other applications:

  • pocketbase: Demonstrates how to integrate Cortex with PocketBase

Tool Provider Examples

The providers directory contains example tool providers that can be used with the Cortex platform:

  • weather: Weather forecast tool provider
  • database: Simple key-value store tool provider

Running the Examples

Stdio Server
go run examples/stdio-server/main.go

This will start a stdio server that accepts JSON-RPC requests from standard input.

SSE Server
go run examples/sse-server/main.go

This will start an HTTP server on port 8080 that accepts MCP requests via Server-Sent Events (SSE).

Multi-Protocol Server
# Run with stdio protocol
go run examples/multi-protocol/main.go -protocol stdio

# Run with HTTP protocol
go run examples/multi-protocol/main.go -protocol http -address localhost:8080

This example shows how to create a server that can switch between stdio and HTTP protocols.

PocketBase Integration
go run examples/integration/pocketbase/main.go

This example demonstrates how to embed Cortex in a PocketBase application, using a mock PocketBase server for simplicity.

Directories

Path Synopsis
integration
pocketbase command
providers
database
Package database provides a database service provider for the Cortex platform.
Package database provides a database service provider for the Cortex platform.
weather
Package weather provides a weather service provider for the Cortex platform.
Package weather provides a weather service provider for the Cortex platform.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL