Skip to main content
Glama
rawveg

Ollama MCP Server

ollama_push

Upload local AI models to the Ollama registry for remote access and sharing across applications.

Instructions

Push a model to the Ollama registry. Uploads a local model to make it available remotely.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modelYesName of the model to push
insecureNoAllow insecure connections
formatNojson

Implementation Reference

  • Core handler function that executes the ollama.push API call to push a model to the registry.
    export async function pushModel(
      ollama: Ollama,
      model: string,
      insecure: boolean,
      format: ResponseFormat
    ): Promise<string> {
      const response = await ollama.push({
        model,
        insecure,
        stream: false,
      });
    
      return formatResponse(JSON.stringify(response), format);
    }
  • Tool registration definition exported from the push module, including name, description, input schema, and handler that validates input and calls the core pushModel function. Discovered by autoloader.
    export const toolDefinition: ToolDefinition = {
      name: 'ollama_push',
      description:
        'Push a model to the Ollama registry. Uploads a local model to make it available remotely.',
      inputSchema: {
        type: 'object',
        properties: {
          model: {
            type: 'string',
            description: 'Name of the model to push',
          },
          insecure: {
            type: 'boolean',
            description: 'Allow insecure connections',
            default: false,
          },
          format: {
            type: 'string',
            enum: ['json', 'markdown'],
            default: 'json',
          },
        },
        required: ['model'],
      },
      handler: async (ollama: Ollama, args: Record<string, unknown>, format: ResponseFormat) => {
        const validated = PushModelInputSchema.parse(args);
        return pushModel(ollama, validated.model, validated.insecure, format);
      },
    };
  • Zod schema used for input validation in the ollama_push tool handler.
    /**
     * Schema for ollama_push tool
     */
    export const PushModelInputSchema = z.object({
      model: z.string().min(1),
      insecure: z.boolean().default(false),
      format: ResponseFormatSchema.default('json'),
    });

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rawveg/ollama-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server