scitex_hub

SciTeX Hub - CLI tools and APIs for SciTeX deployment and management.

Usage:

pip install scitex-hub scitex-hub –help

Python API:
>>> import scitex_hub
>>> client = scitex_hub.CloudClient()
>>> client.scholar_search("neural networks")
>>> client.enrich_bibtex("@article{...}")
MCP Server:

scitex-hub serve # stdio (Claude Desktop) scitex-hub serve -t sse # SSE (remote)

Functions

eval_js(code[, timeout])

Evaluate JavaScript in the user's connected browser.

get_context([page])

Get web app context: username, page, skills, available actions.

get_version()

Get scitex-hub version.

health_check([endpoint])

Check scitex-hub service health.

ui_action(steps[, delay_ms])

Drive browser UI: navigate, highlight, click, fill, scroll.

scitex_hub.get_version() str[source]

Get scitex-hub version.

scitex_hub.health_check(endpoint: str | None = None) dict[source]

Check scitex-hub service health.

Parameters:

endpoint (str, optional) – HTTP endpoint to check. If None, returns local package info.

Returns:

Health status with version, environment, and service status.

Return type:

dict

scitex_hub.get_context(page: str = '', **kw) dict[source]

Get web app context: username, page, skills, available actions.

Convenience wrapper over CloudClient.get_context.

Parameters:
  • page (str, optional) – Page name or URL fragment to query context for. "" means the current page.

  • **kw – Forwarded to CloudClient (e.g. base URL, auth credentials).

Returns:

Context dict (username, page, actions, …).

Return type:

dict

scitex_hub.eval_js(code: str, timeout: int = 10, **kw) dict[source]

Evaluate JavaScript in the user’s connected browser.

Convenience wrapper over CloudClient.eval_js.

Parameters:
  • code (str) – JavaScript code to evaluate.

  • timeout (int, optional) – Seconds to wait for the result (default 10).

  • **kw – Forwarded to CloudClient.

Returns:

Result of the JavaScript evaluation.

Return type:

dict

scitex_hub.ui_action(steps: list, delay_ms: int = 900, **kw) dict[source]

Drive browser UI: navigate, highlight, click, fill, scroll.

Convenience wrapper over CloudClient.ui_action.

Parameters:
  • steps (list) – List of action-step dicts; each describes one browser action.

  • delay_ms (int, optional) – Milliseconds to wait between steps (default 900).

  • **kw – Forwarded to CloudClient.

Returns:

Result summary.

Return type:

dict

class scitex_hub.CloudClient(api_key: str | None = None, base_url: str | None = None)[source]

Python client for SciTeX Hub API.

Parameters:
  • api_key (str, optional) – API key for authenticated endpoints. Falls back to SCITEX_HUB_API_KEY env var.

  • base_url (str, optional) – Cloud server URL. Falls back to SCITEX_HUB_URL env var or https://scitex.ai.

Examples

>>> client = CloudClient()
>>> result = client.scholar_search("machine learning")
>>> print(result["papers"])
__init__(api_key: str | None = None, base_url: str | None = None)[source]
_request(method: str, endpoint: str, data: dict | None = None, files: dict | None = None, auth_required: bool = True) dict[source]

Make HTTP request to SciTeX Hub API.

Search papers via SciTeX Hub (public, no auth required).

Parameters:
  • query (str) – Search query string.

  • limit (int, optional) – Maximum number of results.

Returns:

Search results with papers list.

Return type:

dict

Search CrossRef database via cloud proxy.

Parameters:
  • query (str) – Search query string.

  • rows (int, optional) – Number of results per page.

  • offset (int, optional) – Offset for pagination.

Returns:

CrossRef search results.

Return type:

dict

crossref_by_doi(doi: str) dict[source]

Get CrossRef metadata by DOI.

Parameters:

doi (str) – Digital Object Identifier.

Returns:

CrossRef metadata for the DOI.

Return type:

dict

enrich_bibtex(bibtex_content: str, use_cache: bool = True, timeout: int = 120) str[source]

Enrich BibTeX content with metadata.

Parameters:
  • bibtex_content (str) – BibTeX content to enrich.

  • use_cache (bool, optional) – Whether to use cached results.

  • timeout (int, optional) – Maximum time to wait for enrichment (seconds).

Returns:

Enriched BibTeX content.

Return type:

str

writer_compile(project_id: str, document_type: str = 'manuscript') dict[source]

Compile LaTeX manuscript via cloud.

Parameters:
  • project_id (str) – Project identifier.

  • document_type (str, optional) – Type of document: manuscript, supplementary, revision.

Returns:

Compilation result with PDF URL.

Return type:

dict

project_list_files(project_id: str, path: str = '') dict[source]

List files in a cloud project.

Parameters:
  • project_id (str) – Project identifier.

  • path (str, optional) – Subdirectory path.

Returns:

File listing.

Return type:

dict

get_context(page: str = '') dict[source]

Get web app context for AI agents.

Parameters:

page (str, optional) – Current page URL (e.g. /writer/).

Returns:

Context including username, active skill, all skills, available actions, and aggregated context.

Return type:

dict

eval_js(code: str, timeout: int = 10) dict[source]

Evaluate JavaScript in the user’s browser.

Parameters:
  • code (str) – JavaScript code to evaluate.

  • timeout (int, optional) – Max seconds to wait for result.

Returns:

Evaluation result from the browser.

Return type:

dict

ui_action(steps: list, delay_ms: int = 900) dict[source]

Drive browser UI actions via WebSocket relay.

Parameters:
  • steps (list) – Action steps (navigate, highlight, click, fill, scroll, clear).

  • delay_ms (int, optional) – Delay between steps in milliseconds.

Returns:

Result with number of steps sent.

Return type:

dict

status() dict[source]

Check cloud service status.

Returns:

Status information including cloud availability.

Return type:

dict

class scitex_hub.Environment(name: str, docker_compose_file: str, env_file: str, host: str, port: int, description: str)[source]

Deployment environment configuration.

name: str
docker_compose_file: str
env_file: str
host: str
port: int
description: str
property env_path: Path

Get full path to .env file.

property compose_path: Path

Get full path to docker-compose file.

__init__(name: str, docker_compose_file: str, env_file: str, host: str, port: int, description: str) None
scitex_hub.get_environment(name: str | None = None) Environment[source]

Get environment configuration by name or auto-detect.

class scitex_hub.DockerManager(env: Environment | None = None, project_root: Path | None = None)[source]

Manage Docker containers for SciTeX Hub.

__init__(env: Environment | None = None, project_root: Path | None = None)[source]
_find_project_root() Path[source]

Find project root by looking for pyproject.toml.

_run_compose(args: List[str], capture: bool = False) CompletedProcess[source]

Run docker-compose command.

build(no_cache: bool = False) int[source]

Build Docker containers.

up(detach: bool = True) int[source]

Start Docker containers.

down(volumes: bool = False) int[source]

Stop Docker containers.

restart() int[source]

Restart Docker containers.

logs(follow: bool = False, tail: int | None = None, service: str | None = None) int[source]

Show container logs.

ps() int[source]

Show container status.

status() dict[source]

Get detailed container status.

Modules

appmaker

SciTeX App Tools — init, validate, develop, publish, and manage app plugins.

module

SciTeX Hub Module -- decorator and output APIs for custom workspace modules.

project

SciTeX Hub project management.

sdk

SciTeX SDK — backward-compatible re-export from scitex-app.