@hashgraphonline/conversational-agent
Version:
Hashgraph Online conversational AI agent implementing HCS-10 communication, HCS-2 registries, and content inscription on Hedera. https://hol.org
105 lines (104 loc) • 2.85 kB
JavaScript
const MCPServers = {
/**
* Filesystem server for file operations
*/
filesystem: (path) => ({
name: "filesystem",
command: "npx",
args: ["-y", "@modelcontextprotocol/server-filesystem", path],
transport: "stdio",
autoConnect: true,
additionalContext: "This server provides access to files and directories in the current working directory.",
toolDescriptions: {
list_directory: 'Use this tool when users ask about files in the "current directory" or "working directory".',
read_file: "Use this tool when users ask to see or check files in the current directory."
}
}),
/**
* GitHub server for repository operations
*/
github: (token) => ({
name: "github",
command: "npx",
args: ["-y", "@modelcontextprotocol/server-github"],
...token && { env: { GITHUB_TOKEN: token } },
transport: "stdio",
autoConnect: true
}),
/**
* Slack server for messaging operations
*/
slack: (token) => ({
name: "slack",
command: "npx",
args: ["-y", "@modelcontextprotocol/server-slack"],
env: { SLACK_TOKEN: token },
transport: "stdio",
autoConnect: true
}),
/**
* Google Drive server for document operations
*/
googleDrive: (credentials) => ({
name: "google-drive",
command: "npx",
args: ["-y", "@modelcontextprotocol/server-google-drive"],
env: { GOOGLE_CREDENTIALS: credentials },
transport: "stdio",
autoConnect: true
}),
/**
* PostgreSQL server for database operations
*/
postgres: (connectionString) => ({
name: "postgres",
command: "npx",
args: ["-y", "@modelcontextprotocol/server-postgres", connectionString],
transport: "stdio",
autoConnect: true
}),
/**
* SQLite server for database operations
*/
sqlite: (dbPath) => ({
name: "sqlite",
command: "npx",
args: ["-y", "@modelcontextprotocol/server-sqlite", dbPath],
transport: "stdio",
autoConnect: true
}),
/**
* Custom server configuration
*/
custom: (config) => config
};
function validateServerConfig(config) {
const errors = [];
if (!config.name) {
errors.push("Server name is required");
}
if (!config.command) {
errors.push("Server command is required");
}
if (!config.args || !Array.isArray(config.args)) {
errors.push("Server args must be an array");
}
if (config.transport && !["stdio", "http", "websocket"].includes(config.transport)) {
errors.push("Invalid transport type. Must be stdio, http, or websocket");
}
return errors;
}
function createMCPConfig(servers, autoConnect = true) {
return {
mcpServers: servers.map((server) => ({
...server,
autoConnect: server.autoConnect ?? autoConnect
}))
};
}
export {
MCPServers,
createMCPConfig,
validateServerConfig
};
//# sourceMappingURL=index15.js.map