avantis-mcp
- ✅ Built with Model Context Protocol (MCP) SDK
- 🔐 Integrated authentication via Osiris Hub
- 📊 PostgreSQL database
- 🔷 TypeScript
- 🛠️ Example tools, resources, prompts, and schemas
-
Install dependencies:
pnpm install
-
Configure environment:
cp .env.example .env # Edit .env with your configuration -
Start development server:
pnpm run dev
HUB_BASE_URL- Your Osiris Hub URLOAUTH_CLIENT_ID- OAuth client ID from HubOAUTH_CLIENT_SECRET- OAuth client secret from HubDATABASE_ADAPTER- Database type (postgres)
- Install PostgreSQL
- Create a database:
createdb avantis-mcp - Set
DATABASE_URLin your .env file
pnpm run dev- Start development server with hot reloadpnpm run build- Build for production (TypeScript → JavaScript)pnpm run start- Start production serverpnpm run type-check- Run TypeScript type checking
avantis-mcp/
├── index.ts # Main MCP server entry point
├── client.ts # MCP client setup and configuration
├── tools/
│ └── hello-world.ts # Simple hello world tool
├── resources/
│ └── hello-world.ts # Hello world resource
├── prompts/
│ └── hello-world.ts # Hello world prompt template
├── schema/
│ └── index.ts # Zod schema definitions
├── .env # Environment variables
├── .env.example # Environment template
└── package.json # Dependencies and scripts
A simple greeting tool that demonstrates basic MCP tool functionality.
Usage:
{
"name": "hello_world",
"arguments": {
"name": "Alice"
}
}Provides a simple JSON resource demonstrating MCP resource functionality.
URI: hello://world
Generates prompts about specified topics.
Arguments:
topic(optional): Topic to ask about (default: "osiris")
Create a new file in tools/ and export the tool registration function:
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
import { z } from 'zod';
export function registerMyTool(server: McpServer) {
const MyToolSchema = z.object({
param1: z.string().describe('Parameter description')
});
server.tool('my_tool', 'Description of what this tool does', MyToolSchema, async ({ param1 }) => {
// Your tool logic here
return {
content: [{
type: 'text',
text: `Tool result: ${param1}`
}]
};
});
}Then register it in client.ts.
Create a new file in resources/ and export the resource registration function:
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
export function registerMyResource(server: McpServer) {
server.resource('my://resource', 'My Resource', 'Resource description', async () => {
return {
contents: [{
uri: 'my://resource',
mimeType: 'application/json',
text: JSON.stringify({ data: 'Resource data' })
}]
};
});
}This server uses Osiris Hub for authentication. Make sure your Hub is configured and your OAuth credentials are correct.
-
Build the project:
pnpm run build
-
Set production environment variables
-
Start the server:
NODE_ENV=production pnpm run start
Built with ❤️ using Model Context Protocol and Osiris SDK