Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ Features

## Installation

Add to your **`build.sbt`** (defaulting to **Scala 3.6.4**):
Add to your **`build.sbt`** (defaulting to **Scala 3.7.2**):

```scala
libraryDependencies += "com.tjclp" %% "fast-mcp-scala" % "0.1.1"
libraryDependencies += "com.tjclp" %% "fast-mcp-scala" % "0.1.2"
```

## Quickstart

```scala
//> using scala 3.6.4
//> using dep com.tjclp::fast-mcp-scala:0.1.2-SNAPSHOT
//> using scala 3.7.2
//> using dep com.tjclp::fast-mcp-scala:0.1.2
//> using options "-Xcheck-macros" "-experimental"

import com.tjclp.fastmcp.core.{Tool, ToolParam, Prompt, PromptParam, Resource, ResourceParam}
Expand Down Expand Up @@ -51,7 +51,7 @@ object ExampleServer extends ZIOAppDefault:

override def run =
for
server <- ZIO.succeed(FastMcpServer("ExampleServer", "0.1.1"))
server <- ZIO.succeed(FastMcpServer("ExampleServer", "0.1.2"))
_ <- ZIO.attempt(server.scanAnnotations[Example.type])
_ <- server.runStdio()
yield ()
Expand All @@ -68,7 +68,7 @@ npx @modelcontextprotocol/inspector scala-cli <path_to_repo>/scripts/quickstart.
You can also run examples directly from the command line:
```bash
scala-cli \
-e '//> using dep com.tjclp::fast-mcp-scala:0.1.1' \
-e '//> using dep com.tjclp::fast-mcp-scala:0.1.2' \
--main-class com.tjclp.fastmcp.examples.AnnotatedServer
```

Expand All @@ -83,7 +83,7 @@ In Claude desktop, you can add the following to your `claude_desktop_config.json
"command": "scala-cli",
"args": [
"-e",
"//> using dep com.tjclp::fast-mcp-scala:0.1.1",
"//> using dep com.tjclp::fast-mcp-scala:0.1.2",
"--main-class",
"com.tjclp.fastmcp.examples.AnnotatedServer"
]
Expand Down Expand Up @@ -112,7 +112,7 @@ When hacking on *FastMCP‑Scala* itself, you can consume a local build in any p

In your cloned repository, set a working version
```scala
ThisBuild / version := "0.1.1-SNAPSHOT"
ThisBuild / version := "0.1.3-SNAPSHOT"
```

```bash
Expand All @@ -123,7 +123,7 @@ sbt publishLocal
Then, in your consuming sbt project:

```scala
libraryDependencies += "com.tjclp" %% "fast-mcp-scala" % "0.1.1-SNAPSHOT"
libraryDependencies += "com.tjclp" %% "fast-mcp-scala" % "0.1.3-SNAPSHOT"
```

> `publishLocal` installs the artifact under `~/.ivy2/local` (or the Coursier cache when enabled).
Expand All @@ -145,15 +145,15 @@ Unmanaged JARs placed in a project's `lib/` folder are picked up automatically b

You can use `fast-mcp-scala` in another scala‑cli project:
```scala
//> using scala 3.6.4
//> using dep com.tjclp::fast-mcp-scala:0.1.1
//> using scala 3.7.2
//> using dep com.tjclp::fast-mcp-scala:0.1.2
//> using options "-Xcheck-macros" "-experimental"
```

You can also point directly at the local JAR:

```scala
//> using scala 3.6.4
//> using lib "/absolute/path/to/fast-mcp-scala_3-0.1.1.jar"
//> using scala 3.7.2
//> using jar "/absolute/path/to/fast-mcp-scala_3-0.1.2.jar"
//> using options "-Xcheck-macros" "-experimental"
```
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sonatypeTimeoutMillis := 60000

ThisBuild / sonatypeCredentialHost := sonatypeCentralHost

ThisBuild / version := "0.1.2-SNAPSHOT"
ThisBuild / version := "0.1.2"

val sv = "3.7.2"
ThisBuild / scalaVersion := sv // Using Scala 3
Expand Down
8 changes: 4 additions & 4 deletions scripts/examples.scala → scripts/examples.sc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//> using scala "3.6.4"
//> using dep com.tjclp::fast-mcp-scala:0.1.1
//> using dep com.tjclp::fast-mcp-scala:0.1.2
//> using options "-Xcheck-macros" "-experimental" // Enable verbose macro processing

// This is a launcher file for scala-cli
// You can run any of the MCP server classes with:
//
// scala-cli run examples.scala --main-class com.tjclp.fastmcp.examples.SimpleServer (Basic server example)
// scala-cli run examples.scala --main-class com.tjclp.fastmcp.examples.AnnotatedServer (Annotation-based server with macros)
// scala-cli run examples.scala --main-class com.tjclp.fastmcp.examples.ManualServer (Manual tool registration example)
// scala-cli examples.sc --main-class com.tjclp.fastmcp.examples.SimpleServer (Basic server example)
// scala-cli examples.sc --main-class com.tjclp.fastmcp.examples.AnnotatedServer (Annotation-based server with macros)
// scala-cli examples.sc --main-class com.tjclp.fastmcp.examples.ManualServer (Manual tool registration example)
//
// MACRO ENHANCEMENTS:
// - The AnnotatedServer example demonstrates the enhanced macro-driven approach for
Expand Down
7 changes: 4 additions & 3 deletions scripts/quickstart.scala → scripts/quickstart.sc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//> using scala 3.6.4
//> using repository m2Local
//> using dep com.tjclp::fast-mcp-scala:0.1.2-SNAPSHOT
//> using dep com.tjclp::fast-mcp-scala:0.1.2
//> using options "-Xcheck-macros" "-experimental"

import com.tjclp.fastmcp.core.{Tool, ToolParam, Prompt, PromptParam, Resource, ResourceParam}
Expand Down Expand Up @@ -31,7 +30,9 @@ object ExampleServer extends ZIOAppDefault:

override def run =
for
server <- ZIO.succeed(FastMcpServer("ExampleServer", "0.1.1"))
server <- ZIO.succeed(FastMcpServer("ExampleServer", "0.1.2"))
_ <- ZIO.attempt(server.scanAnnotations[Example.type])
_ <- server.runStdio()
yield ()

ExampleServer.main(args)