Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
71380da
Add Discord service implementation
Sep 26, 2025
313707c
Fix Discord client config handling
Sep 26, 2025
3b82cfe
Fix import paths after renaming sample to samples directory
Sep 26, 2025
9ed5dc4
Update BaseDiscordClient API key usage
Sep 29, 2025
f85893e
Restructure discord client submodule
Sep 29, 2025
f1040d1
Remove extraneous legacy support
Sep 29, 2025
0ffa430
Merge remote-tracking branch 'origin/dev' into feature/discord-clean
Sep 29, 2025
741831f
Fix Discord client tests and complete import path migration
Sep 29, 2025
d8023f6
Update import for tests
Sep 29, 2025
e7671ce
refactor: split Discord client into separate Mindtrace and Service cl…
Oct 1, 2025
05d2d12
feat: implement programmatic Discord command execution via HTTP API
Oct 1, 2025
8c948ba
Move discord samples
Oct 1, 2025
e6bd521
Fix discord tests
Oct 1, 2025
dd0c7d2
Make the discord tests use a separate testing api token
Oct 1, 2025
f95b6df
Add discord samples unit tests
Oct 1, 2025
a9ed701
Fix config unit tests
Oct 1, 2025
9a9d190
Add discord integration tests
Oct 1, 2025
8eb39b9
Add additional discord unit tests
Oct 1, 2025
4f36a7c
Linting fixes
Oct 1, 2025
fa87198
Do not include coverage on skipped lines
Oct 1, 2025
81a6994
Set None for all defaults and fix linting issues
Oct 2, 2025
4f729d1
Fix linting issue
Oct 2, 2025
f81bb90
discord_client.bot.user is None when not connected; fix port conflict
vik-rant Oct 29, 2025
4c1cf9c
Merge branch 'dev' into feature/discord-clean
vik-rant Oct 29, 2025
eb74b53
ruff format
vik-rant Oct 29, 2025
3a52089
fix remaining references to mindtrace.services.sample
vik-rant Oct 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions mindtrace/core/mindtrace/core/config/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ OPENAI = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
DISCORD = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ROBOFLOW = XXXXXXXXXXXXXXXXXXXX

[MINDTRACE_TESTING_API_KEYS]
DISCORD = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

[MINDTRACE_DIR_PATHS]
ROOT = ~/.cache/mindtrace
TEMP_DIR = ${MINDTRACE_DIR_PATHS:ROOT}/temp
Expand Down
5 changes: 5 additions & 0 deletions mindtrace/core/mindtrace/core/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ class MINDTRACE_API_KEYS(BaseModel):
ROBOFLOW: Optional[SecretStr]


class MINDTRACE_TESTING_API_KEYS(BaseModel):
DISCORD: Optional[SecretStr]


class MINDTRACE_DIR_PATHS(BaseModel):
ROOT: str
TEMP_DIR: str
Expand Down Expand Up @@ -72,6 +76,7 @@ def load_ini_settings() -> Dict[str, Any]:

class CoreSettings(BaseSettings):
MINDTRACE_API_KEYS: MINDTRACE_API_KEYS
MINDTRACE_TESTING_API_KEYS: MINDTRACE_TESTING_API_KEYS
MINDTRACE_DIR_PATHS: MINDTRACE_DIR_PATHS
MINDTRACE_DEFAULT_HOST_URLS: MINDTRACE_DEFAULT_HOST_URLS
MINDTRACE_MINIO: MINDTRACE_MINIO
Expand Down
10 changes: 5 additions & 5 deletions mindtrace/services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ The Model Context Protocol (MCP) is a protocol for exposing service functionalit
### Example: EchoService with MCP
See [`mindtrace/services/sample/echo_mcp.py`](./mindtrace/services/sample/echo_mcp.py):
```python
from mindtrace.services.sample.echo_mcp import EchoService
from mindtrace.services.samples.echo_mcp import EchoService

# Launch the service
connection_manager = EchoService.launch(port=8080, host="localhost", wait_for_launch=True, timeout=30)
Expand Down Expand Up @@ -225,7 +225,7 @@ Each `Service` subclass automatically receives a class-level `mcp` helper (MCPCl
Connect to a running service:

```python
from mindtrace.services.sample.echo_mcp import EchoService
from mindtrace.services.samples.echo_mcp import EchoService
import asyncio

async def main():
Expand All @@ -243,7 +243,7 @@ asyncio.run(main())
Launch a new service and get a connected client:

```python
from mindtrace.services.sample.echo_mcp import EchoService
from mindtrace.services.samples.echo_mcp import EchoService
import asyncio

async def main():
Expand All @@ -265,7 +265,7 @@ asyncio.run(main())
Get the MCP client from a connection manager instance:

```python
from mindtrace.services.sample.echo_mcp import EchoService
from mindtrace.services.samples.echo_mcp import EchoService
import asyncio

async def main():
Expand Down Expand Up @@ -304,7 +304,7 @@ Follow these steps to set up and use a remote MCP server with Cursor:
Start your Mindtrace service with MCP enabled. For example, to launch the EchoService:

```python
from mindtrace.services.sample.echo_mcp import EchoService
from mindtrace.services.samples.echo_mcp import EchoService
connection_manager = EchoService.launch(port=8080, host="localhost")
```

Expand Down
2 changes: 1 addition & 1 deletion mindtrace/services/mindtrace/services/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from mindtrace.services.gateway.gateway import Gateway
from mindtrace.services.gateway.proxy_connection_manager import ProxyConnectionManager
from mindtrace.services.gateway.types import AppConfig, RegisterAppTaskSchema
from mindtrace.services.sample.echo_service import EchoService
from mindtrace.services.samples.echo_service import EchoService

__all__ = [
"AppConfig",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def connect(self, url: str | Url | None = None) -> "Client":
FastMCP Client instance for MCP protocol communication

Example::
from mindtrace.services.sample.echo_mcp import EchoService
from mindtrace.services.samples.echo_mcp import EchoService
# Connect to a running EchoService
mcp_client = EchoService.mcp.connect("http://localhost:8000")

Expand Down Expand Up @@ -65,7 +65,7 @@ def launch(self, **launch_kwargs) -> "Client":
FastMCP Client instance connected to the newly launched service

Example::
from mindtrace.services.sample.echo_mcp import EchoService
from mindtrace.services.samples.echo_mcp import EchoService

mcp_client = EchoService.mcp.launch(
host="localhost",
Expand Down
12 changes: 8 additions & 4 deletions mindtrace/services/mindtrace/services/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,19 @@ async def amethod(self, *args, validate_input: bool = True, validate_output: boo

method, amethod = make_method(endpoint_path, endpoint.input_schema, endpoint.output_schema)

# Replace dots with underscores to make it a valid identifier
method_name = endpoint_name.replace(".", "_")

# Set up sync method
method.__name__ = endpoint_name
method.__name__ = method_name
method.__doc__ = f"Calls the `{endpoint_name}` pipeline at `{endpoint_path}`"
setattr(ServiceConnectionManager, endpoint_name, method)
setattr(ServiceConnectionManager, method_name, method)

# Set up async method
amethod.__name__ = f"a{endpoint_name}"
async_method_name = f"a{method_name}"
amethod.__name__ = async_method_name
amethod.__doc__ = f"Async version: Calls the `{endpoint_name}` pipeline at `{endpoint_path}`"
setattr(ServiceConnectionManager, f"a{endpoint_name}", amethod)
setattr(ServiceConnectionManager, async_method_name, amethod)

ServiceConnectionManager.__name__ = class_name
return ServiceConnectionManager
Loading