OpenRouterMcp Documentation
Welcome to the comprehensive API reference for the OpenRouterMcp SDK and Server.
OpenRouterMcp.Sdk.ConversationManager
Manages conversation history and storage.
Methods
SetStoragePath
Sets the root directory for storing conversation files.
SaveConversationAsync
Saves a conversation to disk.
GetConversationContextAsync
Retrieves the full context of a saved conversation.
LoadConversationAsync
Loads a conversation object from disk.
ListConversations
Lists all saved conversations in the current storage path.
OpenRouterMcp.Sdk.FileManager
Provides robust file system operations.
Methods
ReadFileAsync
Reads text content from a file.
WriteFileAsync
Writes text content to a file, overwriting if it exists.
ListFiles
Lists files in a directory matching a pattern.
OpenRouterMcp.Sdk.IModelManager
Interface for AI Model interactions.
Properties
ActiveModel: The currently selected model ID.AppTitle: The application title sent in headers.AppReferer: The referrer URL sent in headers.
Methods
SwitchModel
Changes the active AI model.
ResolveContextAsync
Resolves context based on the prompt.
PromptAsync
Sends a prompt to the AI model and returns the result.
SearchWebAsync
Performs a web search using the configured provider.
PromptStreamAsync
Streams the response from the AI model.
OpenRouterMcp.Sdk.ProcessManager
Manages background processes.
Methods
StartProcess
Starts a new process and returns its PID.
ReadOutput
Reads the standard output of a running process.
KillProcess
Terminates a process by its PID.
ListProcesses
Lists all tracked processes.
OpenRouterMcp.Sdk.ShellExecutor
Executes shell commands.
Methods
ExecuteCommandAsync
Executes a shell command in the specified directory.
OpenRouterMcp Server
Documentation for the MCP Server implementation.
OpenRouterMcp.Server.AgentTools
Exposed tools for external agents (via MCP).
Methods
request_edit
Requests an edit to a specific file.
propose_command
Proposes a command to be executed.
approve_command
Approves the last proposed command.
read_file
Reads the content of a file.
list_files
Lists files in a directory.
create_file
Creates a new file with the specified content.
delete_file
Deletes a file.
switch_model
Switches the model used by the server.
list_conversations
Lists available saved conversations.
save_conversation
Saves the current conversation.
search_web
Performs a web search using the server's tools.
start_process
Starts a process on the host machine.
read_process_output
Reads output from a tracked process.
kill_process
Kills a tracked process.
list_processes
Lists all active tracked processes.
search_files
Searches for content within files.
git_status
Runs git status in the current repo.
git_diff
Runs git diff.
git_log
Returns the git log.