Skip to main content
Glama
Catter58

mcpBPMSoft

by Catter58

Подключиться к BPMSoft

bpm_init
Idempotent

Initializes connection to BPMSoft by providing URL, username, password, OData version, and platform. Verifies credentials and must be run first to enable other tools.

Instructions

Инициализирует подключение к BPMSoft (URL, логин, пароль, версия OData, платформа) и проверяет учётные данные. Должен быть вызван первым, если сервер запущен без переменных окружения BPMSOFT_URL/USERNAME/PASSWORD. После успешного вызова все остальные инструменты становятся работоспособными.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesURL приложения BPMSoft (например: https://mycompany.bpmsoft.com)
usernameYesИмя пользователя для входа
passwordYesПароль пользователя
odata_versionNoВерсия OData протокола: 4 (по умолчанию) или 3
platformNoПлатформа: "net8" (по умолчанию) или "netframework"

Implementation Reference

  • Core handler function that registers the bpm_init MCP tool. Builds config from user input, initializes service container (HttpClient, AuthManager, ODataClient, etc.), attempts login, and on success triggers onInitialized callback to make all other tools operational.
    export function registerInitTool(
      server: McpServer,
      _container: ServiceContainer,
      onInitialized: (newContainer: ServiceContainer) => void
    ): void {
      const meta = getTool('bpm_init');
    
      server.registerTool(
        meta.name,
        {
          title: meta.title,
          description: meta.description,
          inputSchema: {
            url: z.string().describe('URL приложения BPMSoft (например: https://mycompany.bpmsoft.com)'),
            username: z.string().describe('Имя пользователя для входа'),
            password: z.string().describe('Пароль пользователя'),
            odata_version: z
              .number()
              .optional()
              .describe('Версия OData протокола: 4 (по умолчанию) или 3'),
            platform: z
              .string()
              .optional()
              .describe('Платформа: "net8" (по умолчанию) или "netframework"'),
          },
          annotations: meta.annotations,
        },
        async (params): Promise<CallToolResult> => {
          try {
            const config = buildConfig(params.url, params.username, params.password, {
              odata_version: params.odata_version,
              platform: params.platform,
            });
    
            const newContainer = initializeServices(config);
    
            try {
              await newContainer.authManager.login();
            } catch (authError) {
              return {
                content: [
                  {
                    type: 'text',
                    text: [
                      '❌ Ошибка подключения к BPMSoft',
                      '',
                      `URL: ${config.bpmsoft_url}`,
                      `Пользователь: ${config.username}`,
                      `OData: v${config.odata_version}`,
                      `Платформа: ${config.platform}`,
                      '',
                      `Ошибка: ${authError instanceof Error ? authError.message : String(authError)}`,
                      '',
                      'Проверьте URL, логин и пароль и попробуйте снова.',
                    ].join('\n'),
                  },
                ],
                isError: true,
              };
            }
    
            onInitialized(newContainer);
    
            const odataBaseUrl = getODataBaseUrl(config);
            return {
              content: [
                {
                  type: 'text',
                  text: [
                    '✅ Подключение к BPMSoft установлено',
                    '',
                    `URL: ${config.bpmsoft_url}`,
                    `OData endpoint: ${odataBaseUrl}`,
                    `Пользователь: ${config.username}`,
                    `OData: v${config.odata_version}`,
                    `Платформа: ${config.platform}`,
                    '',
                    'Доступные инструменты:',
                    listToolBlurbs(),
                  ].join('\n'),
                },
              ],
              structuredContent: {
                url: config.bpmsoft_url,
                odata_endpoint: odataBaseUrl,
                odata_version: config.odata_version,
                platform: config.platform,
                username: config.username,
                initialized: true,
              },
            };
          } catch (error) {
            return {
              content: [
                {
                  type: 'text',
                  text: `Ошибка инициализации: ${error instanceof Error ? error.message : String(error)}`,
                },
              ],
              isError: true,
            };
          }
        }
      );
    }
  • Tool metadata descriptor for bpm_init: defines name, title, description, MCP annotations (idempotent, open-world), category='init', and a blurb for success listing.
    {
      name: 'bpm_init',
      title: 'Подключиться к BPMSoft',
      description:
        'Инициализирует подключение к BPMSoft (URL, логин, пароль, версия OData, платформа) и проверяет учётные данные. Должен быть вызван первым, если сервер запущен без переменных окружения BPMSOFT_URL/USERNAME/PASSWORD. После успешного вызова все остальные инструменты становятся работоспособными.',
      annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: true },
      blurb: 'инициализация подключения (URL, логин/пароль, OData v3/4, платформа)',
      category: 'init',
    },
  • src/index.ts:62-64 (registration)
    Registration call in the main entry point. Registers the bpm_init tool on the MCP server, passing a callback that replaces the global service container upon successful initialization.
    registerInitTool(server, services, (newContainer) => {
      services = newContainer;
    });
  • Helper used by bpm_init to build BpmConfig from user-provided URL, username, password, OData version, and platform. Also validates compatibility (OData 3 requires .NET Framework).
    export function buildConfig(
      url: string,
      username: string,
      password: string,
      options?: {
        odata_version?: string | number;
        platform?: string;
      }
    ): BpmConfig {
      const odataVersion = parseODataVersion(
        typeof options?.odata_version === 'number'
          ? String(options.odata_version)
          : options?.odata_version
      );
      const platform = parsePlatform(options?.platform);
    
      if (odataVersion === 3 && platform === 'net8') {
  • Creates and wires together all service dependencies (HTTP client, auth, OData, metadata, lookup, process engine) after successful bpm_init.
    export function initializeServices(config: BpmConfig): ServiceContainer {
      const httpClient = new HttpClient(config);
      const authManager = new AuthManager(config, httpClient);
      const odataClient = new ODataClient(config, httpClient);
      const metadataManager = new MetadataManager(config, odataClient, httpClient);
      const lookupResolver = new LookupResolver(config, odataClient, metadataManager);
      const processEngine = new ProcessEngineClient(config, httpClient);
    
      return {
        config,
        httpClient,
        authManager,
        odataClient,
        metadataManager,
        lookupResolver,
        processEngine,
        initialized: true,
      };
    }
    
    export function registerInitTool(
      server: McpServer,
      _container: ServiceContainer,
      onInitialized: (newContainer: ServiceContainer) => void
    ): void {
      const meta = getTool('bpm_init');
    
      server.registerTool(
        meta.name,
        {
          title: meta.title,
          description: meta.description,
          inputSchema: {
            url: z.string().describe('URL приложения BPMSoft (например: https://mycompany.bpmsoft.com)'),
            username: z.string().describe('Имя пользователя для входа'),
            password: z.string().describe('Пароль пользователя'),
            odata_version: z
              .number()
              .optional()
              .describe('Версия OData протокола: 4 (по умолчанию) или 3'),
            platform: z
              .string()
              .optional()
              .describe('Платформа: "net8" (по умолчанию) или "netframework"'),
          },
          annotations: meta.annotations,
        },
        async (params): Promise<CallToolResult> => {
          try {
            const config = buildConfig(params.url, params.username, params.password, {
              odata_version: params.odata_version,
              platform: params.platform,
            });
    
            const newContainer = initializeServices(config);
    
            try {
              await newContainer.authManager.login();
            } catch (authError) {
              return {
                content: [
                  {
                    type: 'text',
                    text: [
                      '❌ Ошибка подключения к BPMSoft',
                      '',
                      `URL: ${config.bpmsoft_url}`,
                      `Пользователь: ${config.username}`,
                      `OData: v${config.odata_version}`,
                      `Платформа: ${config.platform}`,
                      '',
                      `Ошибка: ${authError instanceof Error ? authError.message : String(authError)}`,
                      '',
                      'Проверьте URL, логин и пароль и попробуйте снова.',
                    ].join('\n'),
                  },
                ],
                isError: true,
              };
            }
    
            onInitialized(newContainer);
    
            const odataBaseUrl = getODataBaseUrl(config);
            return {
              content: [
                {
                  type: 'text',
                  text: [
                    '✅ Подключение к BPMSoft установлено',
                    '',
                    `URL: ${config.bpmsoft_url}`,
                    `OData endpoint: ${odataBaseUrl}`,
                    `Пользователь: ${config.username}`,
                    `OData: v${config.odata_version}`,
                    `Платформа: ${config.platform}`,
                    '',
                    'Доступные инструменты:',
                    listToolBlurbs(),
                  ].join('\n'),
                },
              ],
              structuredContent: {
                url: config.bpmsoft_url,
                odata_endpoint: odataBaseUrl,
                odata_version: config.odata_version,
                platform: config.platform,
                username: config.username,
                initialized: true,
              },
            };
          } catch (error) {
            return {
              content: [
                {
                  type: 'text',
                  text: `Ошибка инициализации: ${error instanceof Error ? error.message : String(error)}`,
                },
              ],
              isError: true,
            };
          }
        }
      );
    }
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description adds value beyond annotations. It reveals that the tool validates credentials and that it is a prerequisite for other tools. Annotations already indicate idempotentHint=true and readOnlyHint=false, which are consistent. The behavioral context of 'проверяет учётные данные' (checks credentials) is a key disclosure not present in annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences, front-loaded with the primary action and key constraints. Every word is necessary; no repetition or fluff. It efficiently conveys purpose, prerequisites, and effect.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (5 parameters, critical prerequisite role) and the absence of output schema, the description covers all necessary aspects: what it does, when to call it, and its impact on sibling tools. It is self-contained and sufficient for an AI agent to understand its role in the overall workflow.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%; all parameters have descriptions. The description lists the parameters (URL, login, password, OData version, platform) and adds that they are validated. It also implies defaults for odata_version and platform. This adds meaning beyond the schema by emphasizing credential checking.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states that the tool initializes a connection to BPMSoft with parameters (URL, login, password, OData version, platform) and verifies credentials. It explicitly says it must be called first, distinguishing it from sibling tools that require an active connection.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit guidance: it must be called first if the server is not started with environment variables BPMSOFT_URL/USERNAME/PASSWORD. It also notes that after successful call, all other tools become functional. However, it does not mention cases where env vars are present and the tool should be skipped.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/Catter58/mcpBPMSoft'

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